Elgg  Version master
Variables
checkbox.php File Reference

Go to the source code of this file.

Variables

 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-checkbox')
 Elgg checkbox input Displays a checkbox input tag. More...
 
 $defaults
 
 $default = elgg_extract('default', $vars)
 
if(isset($vars['name'])&&$default!==false) $label = elgg_extract('label', $vars, false)
 
 $label_class = elgg_extract_class($vars, ['elgg-input-single-checkbox'], 'label_class')
 
 $switch = elgg_extract('switch', $vars, false)
 
if($switch$input = elgg_format_element('input', $vars)
 
if($switchif (!empty($label))
 

Variable Documentation

$default = elgg_extract('default', $vars)

Definition at line 30 of file checkbox.php.

$defaults
Initial value:
= [
'default' => 0

Definition at line 23 of file checkbox.php.

if ($switch) $input = elgg_format_element('input', $vars)

Definition at line 53 of file checkbox.php.

if (isset($vars['name'])&&$default!==false) $label = elgg_extract('label', $vars, false)

Definition at line 41 of file checkbox.php.

$label_class = elgg_extract_class($vars, ['elgg-input-single-checkbox'], 'label_class')

Definition at line 42 of file checkbox.php.

$switch = elgg_extract('switch', $vars, false)

Definition at line 46 of file checkbox.php.

$vars = elgg_extract_class($vars, 'elgg-input-checkbox')

Elgg checkbox input Displays a checkbox input tag.

Pass input tag attributes as key value pairs. For a list of allowable attributes, see http://www.w3schools.com/tags/tag_input.asp

$vars['name'] Name of the checkbox $vars['value'] Value of the checkbox $vars['default'] The default value to submit if not checked. Optional, defaults to 0. Set to false for no default. $vars['checked'] Whether this checkbox is checked $vars['switch'] Whether this checkbox is styled as a toggle switch $vars['label'] Optional label string $vars['class'] Additional CSS class $vars['label_class'] Optional class for the label $vars['label_tag'] HTML tag that wraps concatinated label and input. Defaults to 'label'.

Definition at line 21 of file checkbox.php.

if ($switch) if(!empty($label))

Definition at line 62 of file checkbox.php.