/root/Elgg/engine/lib/views.php

Convenience function for generating a form from a view in a standard location. This function assumes that the body of the form is located at "forms/$action" and sets the action by default to "action/$action". Automatically wraps the forms/$action view with a <form> tag and inserts the anti-csrf security tokens.

This automatically appends elgg-form-action-name to the form's class. It replaces any slashes with dashes (blog/save becomes elgg-form-blog-save)

echo elgg_view_form('login');

This would assume a "login" form body to be at "forms/login" and would set the action of the form to "http://yoursite.com/action/login".

If elgg_view('forms/login') is: <input type="text" name="username"> <input type="password" name="password">

Then elgg_view_form('login') generates: <form action="http://yoursite.com/action/login" method="post"> ...security tokens... <input type="text" name="username"> <input type="password" name="password"> </form>

Parameters:
string $action The name of the action. An action name does not include the leading "action/". For example, "login" is an action name.
array $form_vars $vars environment passed to the "input/form" view
array $body_vars $vars environment passed to the "forms/$action" view
Returns:
string The complete form
 All Classes Namespaces Files Functions Variables Enumerations
Generated on Tue May 21 00:01:17 2013 for Elgg by  doxygen 1.6.3