Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2008, 12:28 PM
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default Zend_Layout : Access active controller

Hi

Is it possible to access the active controller from a Zend_Layout template ? Something like

Code:
$this->layout()->getActiveController()
Or maybe theres another solution for my problem. You see I have a sidebar with a custom menu for every page. So I have an array of links in the Controller class and somehow this has to go to the Zend_Layout classes. I'm trying to avoid having to trigger a function in every Controller.



( Hope this makes sense )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-08-2008, 02:45 PM
Junior Member
 
Join Date: Jun 2008
Posts: 18
Default

You should know what your links are before you get there,

If you have 'custom' links you can use the placeholder.
$navs = array('list1','list2','list3');
$this->view->placeholder('myplaceholder')->exchangeArray($navs);
$this->view->placeholder('myplaceholder')->setPrefix('\n<div style="border: 1px solid black"><li>')
->setPostfix("\n\t</li></div>")
->setSeparator('</li><li>');



then in your layout.phtml you use your placeholder.

$this->placeholder('name');

SHOULD work. If I havent made any mistakes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:46 PM.