1

I currently have 3 controllers, AdministratorController.php, ResellerController.php and ServiceProviderController.php.

Each of these have their own actions and views. For instance, AdministratorController.php has the views:

enter image description here

Each of these controllers' views will have exactly the same layout - the only difference in layout being different navigational menus.

So my question is, how I can configure different navigational menus for controllers, but using the same layout?

Many thanks

Charles
  • 50,943
  • 13
  • 104
  • 142
kaese
  • 10,249
  • 8
  • 29
  • 35

1 Answers1

2

Personnaly, my navigation menu is stored in an XML file. When I create my "Zend_Navigation", I load only on part of my navigation menu like this :

$navigation = new Zend_Navigation(new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', $controllerName));
$view->navigation($navigation);

Where "$controllerName" is a section of my "navigation.xml".

In your view:

<?php echo $this->navigation()->menu()->renderMenu(); ?>

Enjoy

Akarun
  • 3,220
  • 2
  • 24
  • 25
  • Thanks Akarun. I'm currently passing an array to the View through the controller's Init which isn't ideal. Will experiment with your technique and see how it goes! Cheers. – kaese Mar 15 '11 at 09:41