public function rules() { $rules = parent::rules(); $rules['prefix'] = array(array('not_empty'), array('min_length', array(':value', 0)), array('max_length', array(':value', 5)), array(array($this, 'notReserved')), array(array($this, 'uniquePrefix'))); $rules['location'] = array(array('not_empty'), array('min_length', array(':value', 0)), array('max_length', array(':value', 255))); return $rules; }
public function rules() { $rules = parent::rules(); $rules['email'] = array(array('not_empty'), array('email'), array(array($this, '_valid_unique'), array('email', ':value'))); $rules['gname'] = array(array('not_empty')); $rules['sname'] = array(array('not_empty')); $rules['phone'] = array(array('phone'), array(array($this, '_valid_unique'), array('phone', ':value'))); $rules['password'] = array(array('not_empty'), array('min_length', array(':value', 6)), array('max_length', array(':value', 255))); $rules['status'] = array(array(array($this, '_valid_status_code'))); return $rules; }
public function rules() { $rules = parent::rules(); $rules['phone'] = array(array('phone')); $rules['agree_toc'] = array(array('range', array(':value', 0, 1))); //This field is not triggered? $rules['pass_id'] = array(array(array($this, '__valid_pass'))); $rules['reg_id'] = array(array('not_empty'), array(array($this, '__check_regID_availability'))); $rules['email'] = array(array('email')); $rules['dob'] = array(array('date')); foreach ($this->formo_defaults as $field => $fieldData) { if (!isset($rules[$field])) { $rules[$field] = array(); } if (isset($fieldData['required']) && $fieldData['required']) { array_push($rules[$field], array('not_empty')); } else { array_push($rules[$field], array('min_length', array(':value', 0))); } array_push($rules[$field], array('max_length', array(':value', 255))); } return $rules; }
/** * Rules for the user model * * @return array Rules */ public function rules() { return array_merge(parent::rules(), array()); }