Sets validator options
public __construct ( integer | array | Zend_Config $options = [] ) | ||
$options | integer | array | Zend_Config |
/** * Sets validator options * * @param integer|array|Zend_Config $options */ public function __construct($options = array()) { if (!is_array($options)) { $options = func_get_args(); if (!isset($options[1])) { $options[1] = 'utf-8'; } parent::__construct($options[0], $options[0], $options[1]); return; } else { if (isset($options['length'])) { $options['max'] = $options['min'] = $options['length']; } if (isset($options['name'])) { $this->_name = $options['name']; } } parent::__construct($options); }
/** * constructor */ public function __construct() { parent::__construct(array('max' => 255, 'min' => 1)); }
public function __construct($options = array()) { parent::__construct($options); $this->setMessages(array(Zend_Validate_StringLength::INVALID => "Invalid type given. String expected", Zend_Validate_StringLength::TOO_SHORT => "%value% is less than %min% characters long", Zend_Validate_StringLength::TOO_LONG => "%value% is more than %max% characters long")); }
public function __construct($min = 0, $max = null) { $this->_messageTemplates[self::TOO_SHORT] = trlKwfStatic("'%value%' is less than %min% characters long"); $this->_messageTemplates[self::TOO_LONG] = trlKwfStatic("'%value%' is greater than %max% characters long"); parent::__construct(array('min' => $min, 'max' => $max)); }