Elgg defines some standard views for form elements and variable display.
It is highly recommended to use these views when constructing plugin and displaying form data inside your plugins. Not does it mean that your plugin can seamlessly take advantage of extra functionality defined by other plugins (such as a rich text editor), but it also helps protect you from certain exploits.
Contents |
All input fields are encapsulated inside an input/form view. This view accepts the following parameters in its $vars array:
$form_body = "<p>This is my form</p>"; $form_body .= elgg_view('input/text', array('internalname' => 'mytextbox', 'value' => 'Initial value')); $form_body .= elgg_view('input/submit', array('internalname' => 'submit')); echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$CONFIG->url}actions/my/action"));
Input views provide a safe and extendible way of representing data input fields, they all live in "input/xxxxxx".
Output views are the companion to input views and govern the display of input fields such as text, longtext, urls etc.
They all live in "output/xxxxxx".