InputWidgetRadioBase Class Reference
[View]
A radion option button. More...
Inheritance diagram for
InputWidgetRadioBase:
Protected Member Functions |
|
render_input ($attrs, $params, $name, $title, $value, $policy) | |
Render the actual widget. |
|
render_label ($widget, $html_attrs, $params, $name, $title, $value, $policy) | |
Render a label around widget. |
Detailed Description
A radion option button.
Definition at line 8 of file radio.input.widget.php.
Member Function Documentation
InputWidgetRadioBase::render_input | ( | $ | attrs, | |
$ | params, | |||
$ | name, | |||
$ | title, | |||
$ | value, | |||
$ | policy | |||
) | [protected] |
Render the actual widget.
Reimplemented from InputWidgetBaseBase.
Definition at line 12 of file radio.input.widget.php.
00012 { 00013 $options = Arr::get_item($attrs, 'options', array()); 00014 unset($attrs['options']); 00015 00016 $ret = ''; 00017 $id = Arr::get_item($attrs, 'id', ''); 00018 foreach(Arr::force($options, false) as $opt_key => $opt_value) { 00019 $attrs_copy = $attrs; 00020 $attrs_copy['value'] = $opt_key; 00021 if ($id) { 00022 $attrs_copy['id'] = $id . '_' . $opt_key; 00023 if ($opt_key == $value) { 00024 $attrs_copy['checked'] = 'checked'; 00025 } 00026 } 00027 $radio_html = ''; 00028 $radio_html .= html::input('radio', $name, $attrs_copy); 00029 $radio_html .= ' ' . String::escape($opt_value); 00030 $radio_html = html::label($radio_html, '', 'spanning'); 00031 $ret .= $radio_html; 00032 } 00033 return $ret; 00034 }
InputWidgetRadioBase::render_label | ( | $ | widget, | |
$ | html_attrs, | |||
$ | params, | |||
$ | name, | |||
$ | title, | |||
$ | value, | |||
$ | policy | |||
) | [protected] |
Render a label around widget.
Reimplemented from InputWidgetBaseBase.
Definition at line 39 of file radio.input.widget.php.
00039 { 00040 return parent::render_label($widget, $html_attrs, $params, $name, $title, $value, $policy | WidgetInput::NO_LABEL); 00041 }
The documentation for this class was generated from the following file:
- gyro/core/view/widgets/input/base/radio.input.widget.php