當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DropdownField::__construct方法代碼示例

本文整理匯總了PHP中DropdownField::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP DropdownField::__construct方法的具體用法?PHP DropdownField::__construct怎麽用?PHP DropdownField::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DropdownField的用法示例。


在下文中一共展示了DropdownField::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 function __construct($name, $title, $value = '')
 {
     if (!$value) {
         $value = Geoip::visitor_country();
     }
     parent::__construct($name, $title, Geoip::getCountryDropDown(), $value);
 }
開發者ID:ramziammar,項目名稱:websites,代碼行數:7,代碼來源:CountryDropdownField.php

示例2: __construct

 public function __construct($name, $title = null, $source = array(), $value = "", $extraAttributes = null, $form = null, $emptyString = null)
 {
     if (is_array($extraAttributes)) {
         $this->extraAttributes = $extraAttributes;
     }
     parent::__construct($name, $title, $source, $value, $extraAttributes, $form, $emptyString);
 }
開發者ID:helpfulrobot,項目名稱:heyday-silverstripe-flexiblefields,代碼行數:7,代碼來源:FlexibleDropdownField.php

示例3: __construct

 public function __construct($name, $title = null, $source = null, $value = "", $form = null)
 {
     if (!is_array($source)) {
         $source = ColorpaletteHelper::get_palette();
     }
     parent::__construct($name, $title === null ? $name : $title, $source, $value, $form);
 }
開發者ID:andrewandante,項目名稱:silverstripe-calendar,代碼行數:7,代碼來源:ColorpaletteField.php

示例4: __construct

 public function __construct($name, $title = null, $source = null, $value = "", $form = null)
 {
     $source = SiteConfig::current_site_config()->getCountriesList(true);
     parent::__construct($name, $title, $source, $value, $form);
     $this->setHasEmptyDefault(true);
     $this->setEmptyString(self::$defaultname);
 }
開發者ID:helpfulrobot,項目名稱:silvershop-core,代碼行數:7,代碼來源:RestrictionRegionCountryDropdownField.php

示例5: __construct

 public function __construct($name, $title, $sourceObject, $keyField = 'ID', $labelField = 'Title', $imageField = 'Image', $value = '', $form = null)
 {
     $this->keyField = $keyField;
     $this->labelField = $labelField;
     $this->imageField = $imageField;
     parent::__construct($name, $title === null ? $name : $title, $sourceObject, $value, $form);
     $this->addExtraClass('dropdown');
 }
開發者ID:helpfulrobot,項目名稱:copperis-dropdownimagefield,代碼行數:8,代碼來源:DropdownImageField.php

示例6: array

 /**
  * @param string $name
  * @param string $title
  * @param string $className 
  */
 function __construct($name, $title, $value = null, $form = null, $currentID = null, $currentTitle = null)
 {
     $optionArray = $this->_getOptions();
     $extraFields = array(array('value' => 'any', 'title' => 'Any Location'));
     $optionArray = array_merge($extraFields, $optionArray);
     //Debug::show($optionArray);
     parent::__construct($name, $title, $optionArray, $value, $form, null);
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-business-directory,代碼行數:13,代碼來源:LocationTreeDropdown.php

示例7: __construct

 public function __construct($name, $title = null, $source = null, $value = '', $form = null, $emptyString = null)
 {
     // Get the regions from config.yml
     parent::__construct($name, $title === null ? $name : $title, $value, $form);
     if (!$source) {
         $this->setSource(self::$regions);
     }
 }
開發者ID:helpfulrobot,項目名稱:joshkosmala-silverstripe-nzregiondropdownfield,代碼行數:8,代碼來源:NZRegionDropdownField.php

示例8: __construct

 public function __construct($name, $title = null, $source = array(), $value = '', $form = null, $emptyString = null)
 {
     /**
      * enable the chzn javascript
      */
     $this->addExtraClass('dropdown');
     parent::__construct($name, $title === null ? $name : $title, $value, $form);
 }
開發者ID:helpfulrobot,項目名稱:toastnz-silverstripe-site-designer,代碼行數:8,代碼來源:FontFamilyDropdownField.php

示例9:

 function __construct($name, $title = null, $timeFormat = "", $value = "", $form = null, $emptyString = null)
 {
     $source = $this->buildSource();
     $this->source = $source;
     if ($timeFormat) {
         $this->{$timeFormat} = $timeFormat;
     }
     parent::__construct($name, $title, $source, $value, $form, $emptyString);
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-form-fields,代碼行數:9,代碼來源:DropdownTimeOnlyField.php

示例10: __construct

 /**
  * Creates a new dropdown field.
  * 
  * @param string $name The field name
  * @param string $title The field title
  * @param array $source An map of the dropdown items
  * @param string|array $value You can pass an array of values or a single value like a drop down to be selected
  * @param int $size Optional size of the select element
  * @param form The parent form
  */
 public function __construct($name, $title = '', $source = array(), $value = '', $size = null, $multiple = false)
 {
     if ($size) {
         $this->size = $size;
     }
     if ($multiple) {
         $this->multiple = $multiple;
     }
     parent::__construct($name, $title, $source, $value);
 }
開發者ID:normann,項目名稱:sapphire,代碼行數:20,代碼來源:ListboxField.php

示例11: __construct

 public function __construct($name, $title = null, $value = '', $form = null, $emptyString = null)
 {
     $this->addExtraClass('dropdown');
     $source = ColourSchemes::get()->sort('ID')->map('CSSColor', 'OPColor');
     parent::__construct($name, $title, $source, $value, $form, $emptyString);
     $this->toggleStar();
     Requirements::css(OPCOLORWORKINGFOLDER . '/css/OpColorField.css');
     Requirements::javascript(OPCOLORWORKINGFOLDER . '/javascript/OpColorField.js');
     $this->hasEmptyDefault = true;
 }
開發者ID:otago,項目名稱:opcolor,代碼行數:10,代碼來源:OpColorField.php

示例12: foreach

 function __construct($name, $title = null, $value = '')
 {
     foreach (self::$font_families as $fontFamily) {
         foreach (self::$generic_families as $genericFamily) {
             $font = (strpos($fontFamily, ' ') ? "'{$fontFamily}'" : $fontFamily) . ", {$genericFamily}";
             $fonts[strtolower($font)] = $font;
         }
     }
     parent::__construct($name, $title, $fonts, $value);
 }
開發者ID:helpfulrobot,項目名稱:sunnysideup-form-fields,代碼行數:10,代碼來源:FontField.php

示例13: array

 /**
  * Creates a new dropdown field.
  * @param name The field name
  * @param title The field title
  * @param source An map of the dropdown items
  * @param value You can pass an array of values or a single value like a drop down to be selected
  * @param form The parent form
  */
 function __construct($name, $title = "", $source = array(), $value = array(), $size = null, $multiple = null, $form = null)
 {
     if ($size) {
         $this->size = $size;
     }
     if ($multiple) {
         $this->multiple = $multiple;
     }
     parent::__construct($name, $title, $source, $value, $form);
 }
開發者ID:ramziammar,項目名稱:websites,代碼行數:18,代碼來源:ListboxField.php

示例14:

 function __construct($name, $title = null, $source = null, $value = "", $form = null)
 {
     if (!is_array($source)) {
         $source = Geoip::getCountryDropDown();
     }
     if (!$value) {
         $value = Geoip::visitor_country();
     }
     parent::__construct($name, $title === null ? $name : $title, $source, $value, $form);
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:10,代碼來源:CountryDropdownField.php

示例15:

 function __construct($name, $title = null, $source = null, $value = "", $form = null, $emptyString = null)
 {
     if (!$source) {
         $source = self::$states;
     }
     if (!$emptyString) {
         $this->hasEmptyDefault = $this->stat('default_has_empty');
         $this->emptyString = $this->stat('default_empty_string');
     }
     parent::__construct($name, $title, $source, $value, $form, $emptyString);
 }
開發者ID:helpfulrobot,項目名稱:briceburg-silverstripe-flexifields,代碼行數:11,代碼來源:USStateDropdownField.php


注:本文中的DropdownField::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。