Example #1
0
 public function actionAdd()
 {
     $model = new LogType();
     if ($model->load(\Yii::$app->request->post()) && $model->validate() && $model->save()) {
         return $this->render('add', ['model' => $model]);
     } else {
         return $this->render('add', ['model' => $model]);
     }
 }
Example #2
0
 /**
  * return array
  */
 public static function findLogTypelists()
 {
     $listarray = [];
     $lists = LogType::find()->all();
     foreach ($lists as $oneItems) {
         $listarray[$oneItems->id] = $oneItems->type_cn_name;
     }
     return $listarray;
 }