On 27.10.2010, at 08:59, Fabien Potencier wrote:
> On 10/27/10 12:23 AM, Lukas Kahwe Smith wrote:
>> Hi,
>>
>> I think the _format routing magic needs a bit of tweaking to be really
>> useful.
>>
>> Summary:
>> 3) Also make sure that there is an automatic fallback in case the format
>> specific template is missing. This is important since for example there is
>> no form.json.twig/widget.json.twig bundled with Symfony2 and without them an
>> error is raised when Twig loads the form extension when _format is something
>> else than html.
>
> I'm not sure a fallback makes sense here. What will it do? Instead, we should
> fix the Twig Form extension somewhat. I don't know how right now but I will
> create a ticket about the issue. Basically, there is two possibilities I see:
> initialize the resources as late as possible (it is a good idea anyway),
> force the format to HTML for these resources. I have created a ticket for
> that.
Yeah, a fallback has the risk of being a bit surprising in a bad way.
What surprised me was that even though I set form/widget templates of my own I
still got an error on a json request until I added a form.json.twig and
widget.json.twig template into the TwigBundle Resource dir:
twig.config:
auto_reload: true
form:
resources: ['FooBundle::widgets.twig', 'FooBundle::form.twig']
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]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en