InputWidgetSelectBase Class Reference
[View]
A select box. More...
Inheritance diagram for
InputWidgetSelectBase:
Protected Member Functions |
|
render_input ($attrs, $params, $name, $title, $value, $policy) | |
Render the actual widget. |
Detailed Description
A select box.
Definition at line 8 of file select.input.widget.php.
Member Function Documentation
InputWidgetSelectBase::render_input | ( | $ | attrs, | |
$ | params, | |||
$ | name, | |||
$ | title, | |||
$ | value, | |||
$ | policy | |||
) | [protected] |
Render the actual widget.
Reimplemented from InputWidgetBaseBase.
Definition at line 12 of file select.input.widget.php.
00012 { 00013 $options = Arr::get_item($attrs, 'options', array()); 00014 $nodefault = Arr::get_item($attrs, 'nodefault', false); 00015 unset($attrs['options']); 00016 unset($attrs['nodefault']); 00017 if (empty($value) && $nodefault) { 00018 // This preservers numeric keys, array_merge destroys them 00019 $new_options = array('' => tr('Please choose...', 'core')); 00020 foreach($options as $key => $v) { 00021 $new_options[$key] = $v; 00022 } 00023 $options = $new_options; 00024 } 00025 $ret = html::select($name, $options, $value, $attrs); 00026 return $ret; 00027 }
The documentation for this class was generated from the following file:
- gyro/core/view/widgets/input/base/select.input.widget.php