Alex Chrome
Alex Chrome

Reputation: 215

Pre-render hook in symfony?

There is something like pre-render hook in symfony 1.4? I want to execute some code right before view render starts.

Upvotes: 2

Views: 1102

Answers (3)

ncuesta
ncuesta

Reputation: 760

You can also set a filter before the view is rendered in the <app>/config/filters.yml file. For further details, take a look here.

Upvotes: 1

Jeremy Kauffman
Jeremy Kauffman

Reputation: 10413

Symfony allows you to configure the view class used at the module level (module.yml):

all:                  # For all environments
  view_class:         myPHP

You could then create a myPHPView class and override the sfPHPView::render method.

Upvotes: 0

kpower
kpower

Reputation: 3891

Try to use preExecute() in action class: http://www.symfony-blog.co.uk/tag/preexecute/.

Upvotes: 0

Related Questions