Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony action name in template

How can I get the action name inside a template? The template is actually a partial.

like image 252
prongs Avatar asked Dec 09 '11 16:12

prongs


2 Answers

You should try :

$sf_params->get('action')
like image 200
Pascal Avatar answered Sep 22 '22 12:09

Pascal


The sfContext instance should be automagically exposed in the view layer as $sf_context so you could do: $sf_context->getActionName().

However i think this may not necessarily be the action youre looking for, because i think it may be the current action being processed which if its a partial for a component would be the component's action. Not 100% on that as ive never had a need to use/investigate :-)

like image 31
prodigitalson Avatar answered Sep 21 '22 12:09

prodigitalson