Skip to content

Typo in Form collections > prototype > PHP block #1906

@Elexandre

Description

@Elexandre

Hello,

I think there is a typo in the doc in:
http://symfony.com/doc/current/cookbook/form/form_collections.html#cookbook-form-collections-new-prototype

In the second source bloc, in the PHP tab:

<ul class="tags" data-prototype="<?php echo $view->escape($view['form']->row($form['tags']->getVar('prototype'))) ?>">
   ...
</ul >

In fact, there is no "getVar()" method in "Symfony\Component\Form\FormView".
A possible way to handle this would be to access the variables via the get() method like this :

<ul class="tags" data-prototype="<?php echo $view->escape($view['form']->row($form['tags']->get('prototype') )) ?>">
    ...
</ul >

Edit:
I just saw that this method is present in the master branch, but not in the 2.1 version, so the code should only be changed for the 2.1 Documentation.
I search over other pages, but i did not found this typo on any other page.
And thanks to stof for his markdown tip.

Hope it helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions