FormHelper::form()

string form(FormView $view, array $variables = array())

Renders the HTML for a form.

Example usage:

<?php echo view['form']->form($form) ?>

You can pass options during the call:

<?php echo view['form']->form($form, array('attr' => array('class' => 'foo'))) ?>

<?php echo view['form']->form($form, array('separator' => '+++++')) ?>

This method is mainly intended for prototyping purposes. If you want to control the layout of a form in a more fine-grained manner, you are advised to use the other helper methods for rendering the parts of the form individually. You can also create a custom form theme to adapt the look of the form.

Parameters

FormView $view The view for which to render the form
array $variables Additional variables passed to the template

Return Value

string The HTML markup
doc_Symfony
2016-10-28 06:18:50
Comments
Leave a Comment

Please login to continue.