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 fin

FormHelper::errors()

string errors(FormView $view) Renders the errors of the given view. Parameters FormView $view The view to render the errors for Return Value string The HTML markup

FormHelper::end()

string end(FormView $view, array $variables = array()) Renders the form end tag. Example usage templates: <?php echo $view['form']->end($form) ?>> Parameters FormView $view The view for which to render the end tag array $variables Additional variables passed to the template Return Value string The HTML markup

FormHelper::csrfToken()

string csrfToken(string $tokenId) Returns a CSRF token. Use this helper for CSRF protection without the overhead of creating a form. echo $view['form']->csrfToken('rmuser'.$user->getId()); Check the token in your action using the same CSRF token id. $csrfProvider = $this->get('security.csrf.tokengenerator'); if (!$csrfProvider->isCsrfTokenValid('rmuser_'.$user->getId(), $token)) { throw new \RuntimeException('CSRF attack detected.'); } Parameters string $

FormHelper::block()

string block(FormView $view, string $blockName, array $variables = array()) Renders a block of the template. Parameters FormView $view The view for determining the used themes string $blockName The name of the block to render array $variables The variable to pass to the template Return Value string The HTML markup

FormHelper

class FormHelper extends Helper FormHelper provides helpers to help display forms. Methods setCharset(string $charset) Sets the default charset. from Helper string getCharset() Gets the default charset. from Helper __construct(FormRendererInterface $renderer) string getName() Returns the canonical name of this helper. setTheme(FormView $view, string|array $themes) Sets a theme for a given view. string form(FormView $view, array $variables = array()) Renders the HT

FormFieldRegistry::remove()

remove(string $name) Removes a field and its children from the registry. Parameters string $name The fully qualified name of the base field

FormFieldRegistry::has()

bool has(string $name) Tests whether the form has the given field. Parameters string $name The fully qualified name of the field Return Value bool Whether the form has the given field

FormFieldRegistry::all()

FormField[] all() Returns the list of field with their value. Return Value FormField[] The list of fields as array((string) Fully qualified name => (mixed) value)

FormFieldRegistry::add()

add(FormField $field) Adds a field to the registry. Parameters FormField $field The field