예제 #1
0
 /**
  * Return the validation information related to this field. This is 
  * interrupted as a JSON object for validate plugin and used in the 
  * PHP. 
  *
  * @see http://docs.jquery.com/Plugins/Validation/Methods
  * @return array
  */
 public function getValidation()
 {
     $options = parent::getValidation();
     if ($this->getSetting('MinLength')) {
         $options['minlength'] = $this->getSetting('MinLength');
     }
     if ($this->getSetting('MaxLength')) {
         $options['maxlength'] = $this->getSetting('MaxLength');
     }
     return $options;
 }
예제 #2
0
 /**
  * Return the validation information related to this field. This is 
  * interrupted as a JSON object for validate plugin and used in the 
  * PHP. 
  *
  * @see http://docs.jquery.com/Plugins/Validation/Methods
  * @return Array
  */
 public function getValidation()
 {
     return array_merge(parent::getValidation(), array('email' => true));
 }