Exemplo n.º 1
0
 /**
  * Finds user by [[username]]
  *
  * @return Admin|null
  */
 public function getUser()
 {
     if ($this->_admin === false) {
         $this->_admin = AdminAuth::findByEmail($this->username);
     }
     return $this->_admin;
 }
 /**
  * @param $model
  * @return array
  */
 protected function ajaxValidate(AdminAuth $model)
 {
     if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
         Yii::$app->response->format = Response::FORMAT_JSON;
         return ActiveForm::validate($model);
     }
     return false;
 }