public function actionViewFileEdit()
{
$rootViewFile = \Yii::$app->request->get('root-file');
$model = new ViewFileEditModel(['rootViewFile' => $rootViewFile]);
$rr = new RequestResponse();
if ($rr->isRequestAjaxPost()) {
if ($model->load(\Yii::$app->request->post())) {
if (!$model->saveFile()) {
$rr->success = false;
$rr->message = "Не удалось сохранить файл.";
}
$rr->message = "Сохранено";
$rr->success = true;
}
return $rr;
}
return $this->render($this->action->id, ['model' => $model]);
}