本文整理汇总了PHP中Select::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Select::__construct方法的具体用法?PHP Select::__construct怎么用?PHP Select::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Select
的用法示例。
在下文中一共展示了Select::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct($parent, $id, $args = array())
{
$this->special_args('label-class', $args);
$this->label_class = trim('checkbox ' . $this->label_class);
$this->has_multiple_values = true;
parent::__construct($parent, $id, $args);
}
示例2: __construct
/**
* Constructor
*
* @param string $caption caption
* @param string $name name
* @param mixed $value Pre-selected value (or array of them).
* @param integer $size Number of rows. "1" makes a drop-down-list
*/
public function __construct($caption, $name, $value = null, $size = 1)
{
parent::__construct($caption, $name, $value, $size, false);
$this->addOption(XOOPS_MATCH_START, \XoopsLocale::STARTS_WITH);
$this->addOption(XOOPS_MATCH_END, \XoopsLocale::ENDS_WITH);
$this->addOption(XOOPS_MATCH_EQUAL, \XoopsLocale::MATCHES);
$this->addOption(XOOPS_MATCH_CONTAIN, \XoopsLocale::CONTAINS);
}
示例3: foreach
/**
* Constructor
*
* @param string $name
* @param string $selectedValue
* @param Option $optionsTags
* @param string or array $options
* @author Justin Palmer
*/
function __construct($name, array $array, $selectedValue = null, $options = null)
{
$options = $this->preparePrompt($options);
foreach ($array as $option) {
$this->display .= $option;
}
parent::__construct($name, $selectedValue, null, $options);
}
示例4: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadProducts_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadProducts'));
$this->attributes['load_categorychildren'] = App::getRegistry()->xajaxInterface->registerFunction(array('LoadCategoryChildren_' . $this->_id, $this, 'loadCategoryChildren'));
$this->attributes['datagrid_filter'] = $this->getDatagridfilterData();
}
示例5: __construct
public function __construct($sLabel, $sName, array $aProperties = null)
{
$aOptions = array();
$aKeys = ['-12', '-11', '-10', '-9', '-8', '-7', '-6', '-5', '-4', '-3.5', '-3', '-2', '-1', '+0', '+1', '+2', '+3', '+3.5', '+4', '+4.5', '+5', '+5.5', '+6', '+7', '+8', '+8.75', '+9', '+9.5', '+10', '+10.5', '+11', '+11.5', '+12', '+12.75', '+13', '+14'];
foreach ($aKeys as $sValue) {
$aOptions[$sValue] = t($sValue);
}
parent::__construct($sLabel, $sName, $aOptions, $aProperties);
}
示例6: __construct
public function __construct($sLabel, $sName, array $aProperties = null)
{
$aOptions = array();
$aKeys = ['', 'AF', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AX', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CK', 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'CD', 'DK', 'DJ', 'DM', 'DO', 'TP', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'FX', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GN', 'GW', 'GY', 'HT', 'HM', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IL', 'IT', 'JM', 'JP', 'JO', 'KZ', 'KE', 'KI', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'KP', 'MP', 'NO', 'OM', 'PK', 'PW', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'SH', 'KN', 'LC', 'PM', 'VC', 'SM', 'ST', 'SA', 'SN', 'SC', 'SL', 'SG', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'KR', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'UK', 'US', 'UM', 'UY', 'UZ', 'VU', 'VA', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'WS', 'YE', 'YU', 'ZM', 'ZW'];
foreach ($aKeys as $sValue) {
$aOptions[$sValue] = t($sValue);
}
parent::__construct($sLabel, $sName, $aOptions, $aProperties);
}
示例7: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadClients_' . $this->_id;
$this->_jsFunctionDetails = 'LoadClientData_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
$this->attributes['jsfunctiondetails'] = 'xajax_' . $this->_jsFunctionDetails;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadClients'));
App::getRegistry()->xajaxInterface->registerFunction(array($this->_jsFunctionDetails, $this, 'loadClientDetails'));
}
示例8: __construct
/**
* Constructor
*
* @param string|array $caption Caption or array of all attributes
* @param string $name name
* @param mixed $value Pre-selected value (or array of them).
* Must be \DateTimeZone supported timezone names, or a DateTimeZone object
* @param integer $size Number of rows. "1" makes a drop-down-box.
*/
public function __construct($caption, $name, $value = null, $size = 1)
{
if (is_array($caption)) {
parent::__construct($caption);
} else {
parent::__construct($caption, $name, $value, $size);
}
if (is_a($this->get('value'), '\\DateTimeZone')) {
$this->set('value', $this->get('value')->getName());
}
\Xoops\Core\Lists\TimeZone::setOptionsArray($this);
}
示例9: __construct
/**
* Constructor
*
* @param string|array $caption Caption or array of all attributes
* @param string $name "name" attribute
* @param mixed $value Pre-selected value (or array of them).
* Legal are all 2-letter country codes (in capitals).
* @param int $size Number or rows. "1" makes a drop-down-list
*/
public function __construct($caption, $name = null, $value = null, $size = 1)
{
if (is_array($caption)) {
parent::__construct($caption);
$this->setIfNotSet('size', 1);
} else {
parent::__construct($caption, $name, $value, $size);
$this->setWithDefaults('caption', $caption, '');
$this->setWithDefaults('name', $name, 'name_error');
$this->set('value', $value);
$this->setWithDefaults('size', $size, 1);
}
\Xoops\Core\Lists\Country::setOptionsArray($this);
}
示例10: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
$this->_jsFunction = 'LoadProducts_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadProducts_' . $this->_id));
$this->attributes['load_categorychildren'] = App::getRegistry()->xajaxInterface->registerFunction(array('LoadCategoryChildren_' . $this->_id, $this, 'loadCategoryChildren'));
if (isset($this->attributes['exclude_from'])) {
$this->attributes['exclude_from_field'] = $this->attributes['exclude_from']->getName();
}
if (!isset($this->attributes['exclude'])) {
$this->attributes['exclude'] = array(0);
}
$this->attributes['datagrid_filter'] = $this->getDatagridfilterData();
}
示例11: __construct
public function __construct($attributes)
{
parent::__construct($attributes);
if (!isset($this->attributes['key'])) {
throw new Exception("Datagrid key (attribute: key) not set for field '{$this->attributes['name']}'.");
}
if (!isset($this->attributes['columns'])) {
throw new Exception("Datagrid columns (attribute: columns) not set for field '{$this->attributes['name']}'.");
}
if (!isset($this->attributes['datagrid_init_function']) || !is_callable($this->attributes['datagrid_init_function'])) {
throw new Exception("Datagrid initialization function not set (attribute: datagrid_init_function) for field '{$this->attributes['name']}'. Hint: check whether the method you have specified is public.");
}
$this->_jsFunction = 'LoadRecords_' . $this->_id;
$this->attributes['jsfunction'] = 'xajax_' . $this->_jsFunction;
App::getRegistry()->xajax->registerFunction(array($this->_jsFunction, $this, 'loadRecords_' . $this->_id));
}
示例12: foreach
/**
* Constructor
*
* @param string $name
* @param string $selectedValue
* @param Option $optionsTags
* @param string or array $options
* @author Justin Palmer
*/
function __construct($name, ResultSet $resultSet, $selectedValue = null, $options = null, $optionDisplay = 'name', $id = 'id')
{
$this->optionDisplay = $optionDisplay;
$this->id = $id;
$options = $this->preparePrompt($options);
//$resultSet->rewind();
foreach ($resultSet as $record) {
//var_dump($record);
$optionDisplay = $this->optionDisplay;
$id = $this->id;
$select = false;
if ($record->{$id} === $selectedValue) {
$select = true;
}
$this->display .= new Option($record->{$optionDisplay}, $record->{$id}, $select) . "\n";
}
parent::__construct($name, $selectedValue, null, $options);
}
示例13: __construct
/**
* Construct
* @param string $default
* @param array $options [optional]
*/
public function __construct($default, $options = array())
{
$options = array_merge(array('folder' => '', 'extensions' => array()), $options);
parent::__construct($default, $options);
}
示例14: __construct
public function __construct($identifier, $label, $tax = array('post_tag'), $multiple = true, array $extra_args = array(), $default = "")
{
parent::__construct($identifier, $label, array(), $multiple, $default);
$this->tax = $tax;
$this->extra_args = $extra_args;
}
示例15: __construct
public function __construct($label, $name, array $properties = null)
{
$options = array("" => "--Select State--", "AL" => "Alabama", "AK" => "Alaska", "AZ" => "Arizona", "AR" => "Arkansas", "CA" => "California", "CO" => "Colorado", "CT" => "Connecticut", "DE" => "Delaware", "DC" => "District of Columbia", "FL" => "Florida", "GA" => "Georgia", "HI" => "Hawaii", "ID" => "Idaho", "IL" => "Illinois", "IN" => "Indiana", "IA" => "Iowa", "KS" => "Kansas", "KY" => "Kentucky", "LA" => "Louisiana", "ME" => "Maine", "MD" => "Maryland", "MA" => "Massachusetts", "MI" => "Michigan", "MN" => "Minnesota", "MS" => "Mississippi", "MO" => "Missouri", "MT" => "Montana", "NE" => "Nebraska", "NV" => "Nevada", "NH" => "New Hampshire", "NJ" => "New Jersey", "NM" => "New Mexico", "NY" => "New York", "NC" => "North Carolina", "ND" => "North Dakota", "OH" => "Ohio", "OK" => "Oklahoma", "OR" => "Oregon", "PA" => "Pennsylvania", "RI" => "Rhode Island", "SC" => "South Carolina", "SD" => "South Dakota", "TN" => "Tennessee", "TX" => "Texas", "UT" => "Utah", "VT" => "Vermont", "VA" => "Virginia", "WA" => "Washington", "WV" => "West Virginia", "WI" => "Wisconsin", "WY" => "Wyoming");
parent::__construct($label, $name, $options, $properties);
}