Elgg  Version 4.3
checkbox.php
Go to the documentation of this file.
1 <?php
14 if ($item instanceof \ElggEntity) {
15  $default_value = $item->guid;
16 } elseif ($item instanceof \ElggExtender) {
17  $default_value = $item->id;
18 }
19 
21 if ($value === false) {
22  // no value to select
23  return;
24 }
25 
26 $name = elgg_extract('name', $vars, 'item_id[]');
27 
28 echo elgg_view('input/checkbox', [
29  'name' => $name,
30  'value' => $value,
31  'default' => false,
32 ]);
if($item instanceof\ElggEntity) elseif($item instanceof\ElggExtender) $value
Definition: checkbox.php:20
$item
Render checkbox selector to select the ID of the item.
Definition: checkbox.php:12
$default_value
Definition: checkbox.php:13
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
if($value===false) $name
Definition: checkbox.php:26
$vars['class']
Elgg checkbox input Displays a checkbox input tag.
Definition: checkbox.php:21
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
Definition: item.php:48
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179