Exemplo n.º 1
0
 public function beforeSave($insert)
 {
     if ($insert) {
         $this->upid = yii::$app->request->post('parentKey', 0);
         $this->url = rtrim($this->url);
         $this->upid = $this->upid == 'root' ? 0 : $this->upid;
     }
     return parent::beforeSave($insert);
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         $this->id_student = Yii::$app->session['id_student'];
         $this->collapsed = 1;
         return true;
     } else {
         return false;
     }
 }