Elgg  Version 4.3
color.php
Go to the documentation of this file.
1 <?php
8 $value = elgg_extract('value', $vars);
9 
10 if (!preg_match('/^#[a-f0-9]{6}$/i', $value)) {
11  return;
12 }
13 
14 $vars['style'] = "background-color: $value";
15 $vars['value'] = strtoupper($vars['value']);
16 $vars['class'] = 'elgg-color-box';
17 
18 echo elgg_format_element('span', $vars) . " " . elgg_view("output/text", $vars);
$vars['class']
Elgg color input Displays a color input field.
Definition: color.php:7
$value
Displays the input color.
Definition: color.php:8
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
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179