Elgg  Version 4.x
checkbox.php File Reference

Go to the source code of this file.


 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-checkbox')
 Elgg checkbox input Displays a checkbox input tag. More...
 $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($switch) if(!empty($label)) else

Variable Documentation

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

Definition at line 31 of file checkbox.php.

Initial value:
= [
'default' => 0

Definition at line 23 of file checkbox.php.

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

Definition at line 54 of file checkbox.php.

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

Definition at line 42 of file checkbox.php.

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

Definition at line 43 of file checkbox.php.

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

Definition at line 47 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)) else
Initial value:
elgg echo
Translates a string.
Definition: deprecated.js:530
if($switch) $input
Definition: checkbox.php:54

Definition at line 69 of file checkbox.php.