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