Of course, I think the embedding of the controller is exactly what I
couldn't think to do last night.

Lukas, I'm also following your thread (
http://groups.google.com/group/symfony-devs/browse_thread/thread/ff702eccdd787e8b)
very
closely.

Thanks

Ryan Weaver
Lead Programmer - iostudio - Nashville, TN
http://www.iostudio.com
http://www.thatsquality.com
Twitter: @weaverryan


On Thu, Oct 28, 2010 at 4:41 AM, Fabien Potencier <
[email protected]> wrote:

> On 10/28/10 6:19 AM, weaverryan wrote:
>
>> Hey guys-
>>
>> I've another "best-practice" question for Symfony2. What's the best
>> way to inject variables into a layout? The topic was covered briefly
>> earlier (http://groups.google.com/group/symfony-devs/browse_thread/
>> thread/e46e5bb74fc3a78b/d2aefa40603d1dc6?
>> lnk=gst&q=layout#d2aefa40603d1dc6) where Thibault came to the
>> conclusion that a template helper is necessary (I also don't see
>> another way).
>
> If you want access to a variable in a layout, it means that you need to
> create and embed another controller.
>
> Fabien
>
>
>  Suppose I have a breadcrumb that's a service (and is Countable). I'd
>> like, in Twig, to be able to do the following:
>>
>> <?php if (count($breadcrumbs)): ?>
>>     <div id="breadcrumbs">
>>         <?php echo $breadcrumbs ?>
>>     </div>
>> <?php endif; ?>
>>
>> If I had access to the breadcrumbs service, then the above is trivial
>> in Twig. However, if I need to use an extension to get the service (if
>> that's even the best option), I'm not sure if I can use the extension
>> to retrieve and then loop through a return value (i'm ignorant about
>> Twig in this regard). Is there an event for injecting variables when
>> the view is rendered (the equivalent to template.filter_parameters in
>> sf1) - I don't see one. If not, is there a specific reason why that
>> type of event is a bad pattern?
>>
>> Thanks!
>>
>>
> --
> 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
>

-- 
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