Elgg  Version master
Variables
radio.php File Reference

Go to the source code of this file.

Variables

 $defaults
 Displays a radio input field. More...
 
 $vars = array_merge($defaults, $vars)
 
 $options_values = elgg_extract('options_values', $vars, [])
 
 $input_options = []
 
foreach($options_values as $key=> $value$options = elgg_extract('options', $vars)
 
if(!empty($options)&&empty($input_options)) if(empty($input_options)) $id = elgg_extract('id', $vars, '')
 
 $list_class = elgg_extract_class($vars, ['elgg-input-radios', "elgg-{$vars['align']}"])
 
 $vars ['class'] = 'elgg-input-radio'
 
if(is_array(elgg_extract('value', $vars))) else
 
 $radios = ''
 
 foreach ($input_options as $label=> $option)
 

Variable Documentation

$defaults
Initial value:
= [
'align' => 'vertical'

Displays a radio input field.

$vars['value'] The current value, if any $vars['name'] The name of the input field $vars['options'] An array of strings representing the options for the $vars['options_values'] An associative array of 'value' => ['text' => 'option'] $vars['class'] Additional class of the list. Optional. $vars['align'] 'horizontal' or 'vertical' Default: 'vertical'

Definition at line 13 of file radio.php.

if (!empty($options)&&empty($input_options)) if (empty($input_options)) $id = elgg_extract('id', $vars, '')

Definition at line 54 of file radio.php.

$input_options = []

Definition at line 26 of file radio.php.

$list_class = elgg_extract_class($vars, ['elgg-input-radios', "elgg-{$vars['align']}"])

Definition at line 57 of file radio.php.

foreach ($options_values as $key=> $value) $options = elgg_extract('options', $vars)

Definition at line 42 of file radio.php.

$options_values = elgg_extract('options_values', $vars, [])

Definition at line 23 of file radio.php.

$radios = ''

Definition at line 72 of file radio.php.

$vars = array_merge($defaults, $vars)

Definition at line 21 of file radio.php.

$vars['class'] = 'elgg-input-radio'

Definition at line 62 of file radio.php.

if (is_array(elgg_extract('value', $vars))) else
Initial value:
{
$selected_value = [elgg_strtolower((string) elgg_extract('value', $vars))]
elgg_strtolower()
Wrapper function for mb_strtolower().
Definition: mb_wrapper.php:125
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$vars
Definition: radio.php:21

Definition at line 66 of file radio.php.

foreach($input_options as $label=> $option)

Definition at line 73 of file radio.php.