本文整理匯總了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);
}