public function actionUpdate($path, $rootAlias = '@common') { $root = \Yii::getAlias($rootAlias); $model = new File(); $model->path = $root . $path; $model->loadContent(); if ($model->load(Yii::$app->request->post()) && $model->saveContent()) { return $this->redirect(['index']); } else { return $this->render('update', ['model' => $model, 'path' => $path, 'rootAlias' => $rootAlias]); } }