I am writing a zend application and trying to keep the functionality as modular as possible. Basically I want to drop the folder into the application and have instant functionality.
Anywho; I'm trying to create sidebar links from each module. The method I'm using is to use the bootstrap:
Here is the function in my bootstrap file. I've set the routes in another function.
public function _initNavigation()
{
$navigation = new Zend_Navigation();
$navigation->addPages(
array(
array(
'label' => 'Link Name',
'route' => 'routeA',
'class' => 'heading'
),
array(
'label' => 'Link Name',
'route' => 'routeA',
'params'=>array('param' => 'value'),
),
array(
'label' => 'Link Name',
'params'=>array('param' => 'value'),
'route' => 'routeA'
)
)
);
$this->bootstrap('layout'); //this line giving error :(
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->navigation($navigation);
The error I was getting was:
Resource matching "layout" not found
After some head banging I found that I had to put the module name in front of the resourse in the config/application.ini file, eg:
moduleA.resources.layout.layoutPath = APPLICATION_PATH "/modules/moduleA/views/scripts"
Now here's the question: how do I get the layout resource using a single resource? i.e. without specifying the module name for each new module I use?