views:

247

answers:

1

I need an after filter that will perform a query depending on what layout is chosen by the user for the current page.

Is there a way to see what layout is being used before the page is rendered?

Thanks.

+2  A: 

The after_filter is executed after the page is rendered. In the after_filter you can know which layout has been used, but it's too late if you need to run a query and include the output in the layout.

You should probably follow an other way. If your query is tied to a specific layout, then create an helper containing the query and call the helper in your template.

Otherwise, provide more context about your need and we can suggest a different approach.

Simone Carletti
I have just decide to run the query no matter what. I appreciate your help.
mediaslave