Exemplo n.º 1
0
 /**
  * Creates a new ServiceCategory model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $service = new ServiceCategory();
     if ($service->load(Yii::$app->request->post()) && $service->save()) {
         return $this->redirect(['view', 'id' => $service->id]);
     } else {
         return $this->render('create', ['model' => $service, 'categories' => ServiceCategory::find()->noParents()->all()]);
     }
 }