當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。