Elgg  Version 1.9
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 if (isset($vars['class'])) {
26  $vars['class'] = "elgg-form {$vars['class']}";
27 } else {
28  $vars['class'] = 'elgg-form';
29 }
30 
31 $vars['action'] = elgg_normalize_url($vars['action']);
32 $vars['method'] = strtolower($vars['method']);
33 
34 $body = $vars['body'];
35 unset($vars['body']);
36 
37 // Generate a security header
38 if (!$vars['disable_security']) {
39  $body = elgg_view('input/securitytoken') . $body;
40 }
41 unset($vars['disable_security']);
42 unset($vars['action_name']);
43 
45 
46 echo "<form $attributes><fieldset>$body</fieldset></form>";
elgg_normalize_url($url)
Definition: output.php:290
$defaults
Definition: form.php:18
$body
Definition: form.php:34
$attributes
Definition: form.php:44
elgg echo
Translates a string.
Definition: languages.js:43
elgg_format_attributes(array $attrs=array())
Converts an associative array into a string of well-formed attributes.
Definition: output.php:118
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$vars
Definition: form.php:23