Пример #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Lesson();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Lesson'])) {
         $model->attributes = $_POST['Lesson'];
         if ($model->save()) {
             Yii::app()->user->setFlash('info', '<span class="single-name">' . $model->singleName() . '</span> <b>' . $model->name . '</b> ' . Yii::app()->params['postActions'][Yii::app()->controller->action->id] . '!');
             $this->redirect(array('/lesson'));
         }
     }
     $this->render('create', array('model' => $model));
 }