Ejemplo n.º 1
0
 /**
  * List all section
  */
 public function actionIndex()
 {
     $sectionModel = new Section();
     $sectiontextModel = new SectionText();
     $sectionList = $this->getSectionList();
     if (!empty(Yii::$app->request->isPost)) {
         $form = Yii::$app->request->post("SectionText");
         if (DataManagement::createSection($form['Name'], $sectionModel, $sectiontextModel)) {
             return $this->redirect(["index"]);
         }
     }
     return $this->render("index", ["sectionModel" => $sectionModel, "sectiontextModel" => $sectiontextModel, "sectionList" => $sectionList]);
 }