Elgg  Version 2.3
field.php
Go to the documentation of this file.
1 <?php
2 
13 if (!$input) {
14  return;
15 }
16 
17 $label = elgg_extract('label', $vars, '');
18 $help = elgg_extract('help', $vars, '');
19 
20 $class = elgg_extract_class($vars, 'elgg-field');
21 if (elgg_extract('required', $vars)) {
22  $class[] = "elgg-field-required";
23 }
24 
26 
28  'class' => $class,
29  ], $field);
30 
$class
Definition: field.php:20
elgg_extract_class(array $array, $existing=[])
Extract class names from an array with key "class", optionally merging into a preexisting set...
Definition: elgglib.php:1396
$vars['entity']
$input
Form field view.
Definition: field.php:12
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
if(!$input) $label
Definition: field.php:17
if(elgg_extract('required', $vars)) $field
Definition: field.php:25
elgg echo
Translates a string.
Definition: languages.js:48
$help
Definition: field.php:18
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:1375