コード例 #1
0
 /**
  * Creates a new Systemuser model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Systemuser();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
コード例 #2
0
 public function actionLogin()
 {
     $model = new Systemuser();
     $model->load(Yii::$app->request->post());
     if ($model->name === 'admin' && $model->pwd === 'admin') {
         Yii::$app->session['var'] = 'admin';
         return $this->redirect(['admin/index#1/11']);
     } else {
         return $this->render('login', ['model' => $model]);
     }
 }