The question is not about how to find a solution, there is always a
solution. The point is that the framework should provide an "official"
solution to this. For now, this does not seems to be issue for Fabien, that
is why I open this thread. The view.yml file was very convenient as it
allows quick customization without updating templates or controllers.


On Mon, Oct 4, 2010 at 3:42 PM, Jordi Boggiano <j.boggi...@seld.be> wrote:

> On 04.10.2010 15:11, Fabien Potencier wrote:
> > On 10/4/10 2:52 PM, Thomas Rabaix wrote:
> >> I have one question : how can I change a css or javascript declaration
> >> if the value is hard coded inside the template file ?
> >
> > I'm not sure I understand the question. Within a template/layout, you
> > know which CSS and JS you need, so yes it is "hardcoded", but there is
> > no need to change it, right? And if you want it to be "dynamic", you can
> > have a variable.
>
> Short example of how you could do this with a "view.yml"-like variable:
>
> # config.yml
>
> parameters:
>    css.files:
>        - foo.css
>        - bar.css
>
> # controller
>
> $data = array(
>    'cssFiles' => $this->container->getParameter('css.files'),
> );
>
> # view
>
> {% for file in cssFiles %}
>    {% stylesheet file %}
> {% endfor %}
>
> P.S.: Untested code ;)
>
> Cheers
>
> --
> Jordi Boggiano
> @seldaek :: http://seld.be/
>
> --
> 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 symfony-devs@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-devs+unsubscr...@googlegroups.com<symfony-devs%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
>



-- 
Thomas Rabaix
http://rabaix.net

-- 
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 symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to