Commit d33df89a authored by Shakarim Sapa's avatar Shakarim Sapa

- Добавлен метод и отображение для создания курса

parent 24a52cd4
......@@ -20,6 +20,7 @@ class CourseAdminController extends AdminController {
public static function actionsTitles(){
return [
'Manage' => 'Управление курсами',
'Create' => 'Добавление нового курса'
];
}
......@@ -38,4 +39,21 @@ class CourseAdminController extends AdminController {
]
);
}
public function actionCreate(){
$model = new AnalyticsSchoolCourse();
if ($model->load(\Yii::$app->request->post())) {
if ($model->validate() && $model->save())
return $this->redirect([
'manage'
]);
}
$form = new \common\components\BaseForm('/common/modules/analyticsSchool/forms/CourseForm', $model);
return $this->render(
'create',
[
'form' => $form
]
);
}
}
\ No newline at end of file
<?= $form->out;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment