当前位置: 首页>>代码示例>>PHP>>正文


PHP DateField::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:15,代码来源:CompositeDateField.php

示例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);
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-datefield-simplified,代码行数:6,代码来源:SimpleDateField.php

示例3: __construct

 public function __construct($name, $title = null, $value = null)
 {
     $this->setFieldHolderTemplate('forms/BirthDateField');
     parent::__construct($name, $title, $value);
 }
开发者ID:helpfulrobot,项目名称:lekoala-silverstripe-form-extras,代码行数:5,代码来源:BirthDateField.php

示例4: __construct

 public function __construct($name, $title = null, $value = "")
 {
     $this->setConfig('dateformat', 'mm-dd-yyyy');
     parent::__construct($name, $title, $value);
 }
开发者ID:silverstripers,项目名称:silverstripe-timefield,代码行数:5,代码来源:HTML5DateField.php

示例5: __construct

 public function __construct($name, $title = null, $value = null)
 {
     Config::inst()->update('DateField', 'default_config', self::$default_config);
     parent::__construct($name, $title, $value);
 }
开发者ID:helpfulrobot,项目名称:andrelohmann-silverstripe-legacyfields,代码行数:5,代码来源:DropdownDateField.php


注:本文中的DateField::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。