本文整理汇总了PHP中DateField::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP DateField::__construct方法的具体用法?PHP DateField::__construct怎么用?PHP DateField::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateField
的用法示例。
在下文中一共展示了DateField::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
function __construct($name, $title, $value = null, $yearRange = null)
{
$exploded = explode('-', $value);
$year = isset($exploded[0]) ? $exploded[0] : null;
$month = isset($exploded[1]) ? $exploded[1] : null;
$date = isset($exploded[2]) ? $exploded[2] : null;
$this->dateDropdown = new DropdownField($name . "[date]", "", array('NotSet' => '(' . _t('CompositeDateField.DAY', 'Day') . ')', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31'), $date);
$this->monthDropdown = new DropdownField($name . "[month]", "", array('NotSet' => '(' . _t('CompositeDateField.MONTH', 'Month') . ')', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12'), $month);
if ($yearRange == null) {
$this->customiseYearDropDown($name, "1995-2012", $year);
} else {
$this->customiseYearDropDown($name, $yearRange, $year);
}
parent::__construct($name, $title);
}
示例2: array
function __construct($name, $title = null, $value = null, $form = null, $config = array())
{
parent::__construct($name, $title, $value, $form);
$this->setConfig("dmyfields", false);
$this->setConfig("showcalendar", false);
}
示例3: __construct
public function __construct($name, $title = null, $value = null)
{
$this->setFieldHolderTemplate('forms/BirthDateField');
parent::__construct($name, $title, $value);
}
示例4: __construct
public function __construct($name, $title = null, $value = "")
{
$this->setConfig('dateformat', 'mm-dd-yyyy');
parent::__construct($name, $title, $value);
}
示例5: __construct
public function __construct($name, $title = null, $value = null)
{
Config::inst()->update('DateField', 'default_config', self::$default_config);
parent::__construct($name, $title, $value);
}