/** * 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; }
/** * 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)); }