Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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 $field_class = (array) elgg_extract('class', $vars, array());
21 $field_class[] = 'elgg-field';
22 if (elgg_extract('required', $vars)) {
23  $field_class[] = "elgg-field-required";
24 }
25 
27 
28 echo elgg_format_element('div', [
29  'class' => $field_class,
30  ], $field);
31 
$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:218
if(!$input) $label
Definition: field.php:17
if(elgg_extract('required', $vars)) $field
Definition: field.php:26
$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:1310
$field_class
Definition: field.php:20