Example #1
0
 /**
  * Creates a new Category model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Category();
     $model->setAttributes(wanhunet::$app->request->post(), false);
     if ($model->save()) {
         return true;
     } else {
         return current($model->getFirstErrors());
     }
 }