本文整理汇总了PHP中HTML_QuickForm_group::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm_group::__construct方法的具体用法?PHP HTML_QuickForm_group::__construct怎么用?PHP HTML_QuickForm_group::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm_group
的用法示例。
在下文中一共展示了HTML_QuickForm_group::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
*
* The following keys may appear in $options array:
* - 'language': date language
* - 'format': Format of the date, based on PHP's date() function.
* The following characters are currently recognised in format string:
* <pre>
* D => Short names of days
* l => Long names of days
* d => Day numbers
* M => Short names of months
* F => Long names of months
* m => Month numbers
* Y => Four digit year
* y => Two digit year
* h => 12 hour format
* H => 23 hour format
* i => Minutes
* s => Seconds
* a => am/pm
* A => AM/PM
* </pre>
* - 'minYear': Minimum year in year select
* - 'maxYear': Maximum year in year select
* - 'addEmptyOption': Should an empty option be added to the top of
* each select box?
* - 'emptyOptionValue': The value passed by the empty option.
* - 'emptyOptionText': The text displayed for the empty option.
* - 'optionIncrement': Step to increase the option values by (works for 'i' and 's')
*
* @access public
* @param string Element's name
* @param mixed Label(s) for an element
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date';
// Added by Ivan Tcholakov, 16-MAR-2010.
$current_year = intval(api_get_local_time());
$this->_options['minYear'] = $current_year - 9;
$this->_options['maxYear'] = $current_year + 1;
//
// set the options, do not bother setting bogus ones
if (is_array($options)) {
foreach ($options as $name => $value) {
if ('language' == $name) {
$this->_options['language'] = isset($this->_locale[$value]) ? $value : 'en';
} elseif (isset($this->_options[$name])) {
if (is_array($value) && is_array($this->_options[$name])) {
$this->_options[$name] = @array_merge($this->_options[$name], $value);
} else {
$this->_options[$name] = $value;
}
}
}
}
}
示例2:
/**
* Class constructor
*
* @param string $elementName (optional)Input field name attribute
* @param string $elementLabel (optional)Input field label in form
* @param mixed $attributes (optional)Either a typical HTML attribute string
* or an associative array. Date format is passed along the attributes.
* @param mixed $separator (optional)Use a string for one separator,
* use an array to alternate the separators.
* @access public
* @return void
*/
function __construct($elementName = null, $elementLabel = null, $attributes = null, $separator = null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
if (isset($separator)) {
$this->_separator = $separator;
}
$this->_type = 'hierselect';
$this->_appendName = true;
}
示例3: array
/**
* Class constructor
*
* The following keys may appear in $options array:
* - 'language': date language
* - 'format': Format of the date, based on PHP's date() function.
* The following characters are currently recognised in format string:
* <pre>
* D => Short names of days
* l => Long names of days
* d => Day numbers
* M => Short names of months
* F => Long names of months
* m => Month numbers
* Y => Four digit year
* y => Two digit year
* h => 12 hour format
* H => 23 hour format
* i => Minutes
* s => Seconds
* a => am/pm
* A => AM/PM
* </pre>
* - 'minYear': Minimum year in year select
* - 'maxYear': Maximum year in year select
* - 'addEmptyOption': Should an empty option be added to the top of
* each select box?
* - 'emptyOptionValue': The value passed by the empty option.
* - 'emptyOptionText': The text displayed for the empty option.
* - 'optionIncrement': Step to increase the option values by (works for 'i' and 's')
*
* @access public
* @param string Element's name
* @param mixed Label(s) for an element
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date';
// set the options, do not bother setting bogus ones
if (is_array($options)) {
foreach ($options as $name => $value) {
if ('language' == $name) {
$this->_options['language'] = isset($this->_locale[$value]) ? $value : 'en';
} elseif (isset($this->_options[$name])) {
if (is_array($value) && is_array($this->_options[$name])) {
$this->_options[$name] = @array_merge($this->_options[$name], $value);
} else {
$this->_options[$name] = $value;
}
}
}
}
}
示例4: __construct
/**
* constructor
*
* @param string $elementName (optional) name of the group
* @param string $elementLabel (optional) group label
* @param array $elements (optional) array of HTML_QuickForm_element elements to group
* @param string $separator (optional) string to seperate elements.
* @param string $appendName (optional) string to appened to grouped elements.
*/
public function __construct($elementName = null, $elementLabel = null, $elements = null, $separator = null, $appendName = true)
{
parent::__construct($elementName, $elementLabel, $elements, $separator, $appendName);
}