Elgg  Version 4.3
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 if (elgg_extract('disabled', $vars)) {
34  $class[] = 'elgg-field-disabled';
35 }
36 
38 
40  'class' => $class,
41 ], $field);
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:152
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:569
$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:135
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(elgg_extract('required', $vars)) if(elgg_extract('disabled', $vars)) $field
Definition: field.php:37
$input
Form field view.
Definition: field.php:13
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179