Elgg  Version 2.3
form.php
Go to the documentation of this file.
1 <?php
18 $defaults = array(
19  'method' => 'post',
20  'disable_security' => FALSE,
21 );
22 
23 $vars = array_merge($defaults, $vars);
24 
25 $vars['class'] = elgg_extract_class($vars, 'elgg-form');
26 $vars['action'] = elgg_normalize_url($vars['action']);
27 $vars['method'] = strtolower($vars['method']);
28 
29 $body = $vars['body'];
30 unset($vars['body']);
31 
32 // Generate a security header
33 if (!$vars['disable_security']) {
34  $body = elgg_view('input/securitytoken') . $body;
35 }
36 unset($vars['disable_security']);
37 unset($vars['action_name']);
38 
39 echo elgg_format_element('form', $vars, "<fieldset>$body</fieldset>");
elgg_normalize_url($url)
Definition: output.php:280
$defaults
Definition: form.php:18
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
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:208
$body
Definition: form.php:29
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
$vars
Definition: form.php:23