예제 #1
0
 public function actionEmail()
 {
     $data = $_GET;
     $data['email_confirm'] = isset($data['email']) ? $data['email'] : '';
     $validator = new signUpModel();
     $validator->setAttributes($data);
     $validator->validate();
     $emailError = $validator->getError('email');
     $valid = $emailError != null ? false : true;
     echo json_encode($valid);
     YII::app()->end();
 }
예제 #2
0
 /**
  *
  * @todo refactoring this
  * @param type $data
  * @return array 
  */
 protected function signUpValidation($data)
 {
     $errors = array();
     $model = new signUpModel();
     //$zipModel = new signUpZipModel();
     $model->setAttributes($data);
     //$zipModel->setAttributes($data);
     $model->validate();
     //$zipModel->validate();
     $errors = array_merge($model->getErrors());
     return $errors;
 }