本文整理汇总了PHP中Zend_Validate_Date::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Validate_Date::__construct方法的具体用法?PHP Zend_Validate_Date::__construct怎么用?PHP Zend_Validate_Date::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Validate_Date
的用法示例。
在下文中一共展示了Zend_Validate_Date::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs Form_Validate_Date class for validating date input.
* @param array $config Configuration options (see Zend_Validate_Date)
*/
public function __construct($config = null)
{
parent::__construct($config);
// automatically set date format used by Opus
$this->setFormat($this->getDateFormat());
$this->setInputPattern($this->getDatePattern());
}
示例2: __construct
public function __construct($options = array())
{
if (isset($options['outputFormat'])) {
$format = $options['outputFormat'];
unset($options['outputFormat']);
} else {
$format = '%format%';
}
parent::__construct($options);
$this->_messageTemplates[self::INVALID] = "Invalid type given, value should be string, integer, array or Zend_Date";
$this->_messageTemplates[self::INVALID_DATE] = trlKwfStatic("'%value%' does not appear to be a valid date");
$this->_messageTemplates[self::FALSEFORMAT] = trlKwfStatic("'%value%' does not fit the date format '{0}'", array($format));
}
示例3: __construct
/**
* Sets validator options
*
* @return void
*/
public function __construct($minDate = null, $maxDate = null, $allowEmpty = null, $emptyValue = null, $format = null, $locale = null)
{
parent::__construct($format, $locale);
$dummy = new parent();
$this->setMessages($dummy->_messageTemplates);
$this->setMinDate($minDate);
$this->setMaxDate($maxDate);
if (null !== $allowEmpty) {
$this->setAllowEmpty($allowEmpty);
}
if (null !== $emptyValue) {
$this->setEmptyValue($emptyValue);
}
}
示例4: __construct
/**
* Set necessary locale information for validating.
*
*/
public function __construct()
{
parent::__construct(Zend_Date::DATE_MEDIUM, 'de');
}
示例5: __construct
/**
* Sets validator options
*
* @param string $format OPTIONAL
* @param string|Zend_Locale $locale OPTIONAL
* @return void
*/
public function __construct($format = null, $locale = null)
{
parent::__construct($format, $locale);
$this->_messageTemplates[self::END_DATE_EARLIER] = "end date is earlier then start date";
}