Beispiel #1
0
 /**
  * 关联三级导航
  * 一对多关系
  */
 public function getNavitem()
 {
     return $this->hasMany(AgNavitem::className(), ['nbid' => 'id']);
 }
Beispiel #2
0
 public function actionItemedit()
 {
     $id = Yii::$app->request->post('id');
     $model = AgNavitem::findOne($id);
     if ($model === null) {
         Yii::$app->getSession()->setFlash("info", '编辑失败');
         return $this->redirect(['navitem']);
     }
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->getSession()->setFlash('info', '编辑成功!');
         return $this->redirect(['navitem']);
     }
 }