Get current controller from zend_layout

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Get current controller from zend_layout

Post by BornForCode »

I would like to create a menu and highlight the current page (menu items) to be able to do that i have to get the current controller or action from Zend_Layout.

Is there anyone that have a solution because this problem driven me crazzy :banghead:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Get current controller from zend_layout

Post by josh »

$this->_request->_controller
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Get current controller from zend_layout

Post by BornForCode »

In layout.phtml you don't have access to $this->_request, or at least in my case is null :(
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Get current controller from zend_layout

Post by josh »

so assign the variable to the view from the controller
Post Reply