本文整理汇总了PHP中Zend_Validate_StringLength::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Validate_StringLength::__construct方法的具体用法?PHP Zend_Validate_StringLength::__construct怎么用?PHP Zend_Validate_StringLength::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Validate_StringLength
的用法示例。
在下文中一共展示了Zend_Validate_StringLength::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
示例2: __construct
/**
* constructor
*/
public function __construct()
{
parent::__construct(array('max' => 255, 'min' => 1));
}
示例3: __construct
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"));
}
示例4: __construct
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));
}