Elgg  Version 3.0
field.php
Go to the documentation of this file.
1 <?php
14 if (!$input) {
15  return;
16 }
17 
19 unset($vars['view']);
20 
21 if ($view && elgg_view_exists($view)) {
23  return;
24 }
25 
26 $label = elgg_extract('label', $vars, '');
27 $help = elgg_extract('help', $vars, '');
28 
29 $class = elgg_extract_class($vars, 'elgg-field');
30 if (elgg_extract('required', $vars)) {
31  $class[] = "elgg-field-required";
32 }
33 
35 
37  'class' => $class,
38 ], $field);
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
if($view &&elgg_view_exists($view)) $label
Definition: field.php:26
if(!$input) $view
Definition: field.php:18
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:1153
$class
Definition: field.php:29
$help
Definition: field.php:27
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
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:1131
if(elgg_extract('required', $vars)) $field
Definition: field.php:34
$input
Form field view.
Definition: field.php:13
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246