Sounds like a race condition in Twig's guessing algorithm.

If I interpret the docs (
http://www.twig-project.org/doc/templates.html#variables) correctly, using
form['name'] should bypass most of the logic and force array-access.
Additionally, to get things working right away in case this is a bug, you
could try invoking the methods directly:

   - {{ form.getName() }} if you really need the name
   - {{ form.get('name') }} if you want the field

Also, I'm not sure what version of Symfony2 you're using, but I believe the
filters (e.g. "| render") have been replaced with functions, such as
form_field().

On Thu, Jan 13, 2011 at 4:31 PM, Lukas Kahwe Smith <[email protected]>wrote:

>
> On 06.01.2011, at 14:30, dantleech wrote:
>
> > Hi
> >
> > Ive just started using the Twig form helpers and ran into a problem
> > when I tried to render a field by the name of "name".
> >
> > {{ form.name | render }}
> >
> > But this throws an error, as `form.name` is not a text field, but a
> > string. It is the name of the form.
> >
> > The field is defined as a TextField, but is overridden by the property
> > for the name of the form.
> >
> > Is this conflict going to be addressed, or should I expect to work
> > around it in the long term? I regularly use the field name "name" in
> > my schema's ....
>
>
> sounds like a valid concern. i havent investigated things yet.
> i presume the issue doesnt happen when iterating over the form and there is
> possibly a way to access the name field via some explicit getter.
>
> regards,
> Lukas Kahwe Smith
> [email protected]
>
>
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<symfony-devs%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
>



-- 
jeremy mikola

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to