121
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_edit');
$folder = FolderController::findModel($model->id_folder);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
'folder' => $folder,
]);
}
}
/**
* Deletes an existing Document model.
* If deletion is successful, the browser will be redirected to the 'index'
page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$model = $this->findModel($id);
$model->TestAccessByFlag('flag_delete');
$folder = FolderController::findModel($model->id_folder);
$model->delete();
return $this->redirect(['index', 'id_folder' => $folder->id]);