One more Frank: why do you decided to set the container in the Registry
instead of explicitly using ->setContainer()?
Javi
On 01/17/2013 07:26 AM, Frank Brückner wrote:
Hi,
you have to delete something:
protected function _initRequest()
{
$translate = new Zend_Translate('array', APPLICATION_PATH .
'/languages', null, array('scan' =>
Zend_Translate::LOCALE_FILENAME));
$translate->setLocale('en');
Zend_Registry::set('Zend_Translate', $translate);
}
Zend_Loader is not needed.
protected function _initNavigation()
{
$config = new Zend_Config_Xml('your_path', 'nav');
Zend_Registry::set('Zend_Navigation', new Zend_Navigation($config));
}
Look at the docs in the last paragraph before example #33:
http://framework.zend.com/manual/1.12/en/zend.view.helpers.html#zend.view.helpers.initial.navigation
Am 16.01.2013, 20:42 Uhr, schrieb Javier Garcia <tirengar...@gmail.com>:
Hi,
I'm following this video tutorial
<http://www.zendcasts.com/zend_navigation-dynamically-creating-a-menu-a-sitemap-and-breadcrumbs/2009/06/>
to add a navigation menu.
So i just added to my |Bootstrap.php| the function that it says at the
beginning of the video (|_initNavigation()|), so now it is like this:
|class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initRequest()
{
require_once'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Translate');
$translate= new Zend_Translate('array', APPLICATION_PATH.
'/languages', null, array('scan' =>
Zend_Translate::LOCALE_FILENAME));
$translate->setLocale('en');
Zend_Registry::set('Zend_Translate', $translate);
}
protected function _initNavigation()
{
$this->bootstrap('layout');
$layout= $this->getResource('layout');
$view= $layout->getView();
$config= new
Zend_Config_Xml('/home/tirengarfio/workspace/contractlink/contractlink/wwwAPP/configs/navigation.xml',
'nav');
$navigation= new Zend_Navigation($config);
$view->navigation($navigation);
}
}|
But after that I'm getting this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception'
with message 'Plugin by name 'Language' in
/home/tirengarfio/workspace/contractlink/contractlink/library/Zend/Controller/Plugin/Broker.php
on line 336
That error is related to a helper I created, but I didn't get that error
before adding the |initNavigation()| function in the |Bootstrap.php|
file.. So I think the error could be because the new function.. any
help?
Javi
--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com