On 05.03.2011, at 13:07, Sven Paulus wrote:
> This is just an idea, I don't know if it's really useful:
>
> Currently if you are rendering a template from a controller you have to
> specify the bundle and controller name in the template identifier
> ('DominateTheWorldBundle:Default:index.html.twig'). This makes renaming the
> bundle or controller very hard (since there is no IDE refactoring support for
> values within strings) and the whole thing is also error prone (you have to
> type the same stuff over and over again).
>
> One way to solve this is to use the @extra:Template annotation from the
> FrameworkExtraBundle.
>
> What I'd like to be able to do would be defining the template using a
> identifier like '@self:@self:index.html.twig' where the different
> @self-elements expand to the current bundle and controller name (the same way
> you say self::$var and not MyClass::$var in a class). However implementing
> this seems to be quite hard (at least for me) since there is no way for the
> TemplateNameParser to know about the current bundle and controller.
>
> Another approach would be using a syntax like
> __CLASS__.':'.__FUNCTION__.'.html.twig' when defining the template.
> Transforming this into the template name is quite easy (see patch attached
> below, getBundleNameForClass is obviously influenced by the
> AnnotationTemplateListener) - it seems to be useful, but it looks kind of
> ugly ... - so I don't want to sent a pull request right now :)
just FYI you might want to look at:
https://github.com/symfony/symfony/pull/186
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