can't figure out, why does key lang disappears between language plugin and matched custom route. I'm calling registry from inside model, which is requested inside custome route.
http://pastie.org/1088574
Message: No entry is registered for key 'lang'
Stack trace:
#0 C:\xampp\xampp\htdocs\chat\application\models\Getcategories.php(15): Zend_Registry::get('lang')
#1 C:\xampp\xampp\htdocs\chat\library\Routes\Categories.php(64): Getcategories->__construct()
#2 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Router\Rewrite.php(398): Routes_Categories->match('/ru/woman-searc...')
#3 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Front.php(911): Zend_Controller_Router_Rewrite->route(Object(Zend_Controller_Request_Http))
#4 C:\xampp\xampp\htdocs\chat\library\Zend\Controller\Front.php(212): Zend_Controller_Front->dispatch()
#5 C:\xampp\xampp\htdocs\chat\application\Bootstrap.php(65): Zend_Controller_Front::run('C:\xampp\xampp\...')
#6 C:\xampp\xampp\htdocs\chat\public\index.php(34): Bootstrap->run(Array)
#7 {main}
I have checked inside language plugin, it registers lang key fine.
Zend_Registry::get('lang') ins开发者_如何转开发ide route throws exception as well.
Make sure the Registry-Key is set in Plugins_LangSelector::routeStartup()
so it will be registered before processing the routes.
From the ZF-Manual: Plugins
routeStartup() is called before Zend_Controller_Front calls on the router to evaluate the request against the registered routes.
If you set the key in routeShutdown(), preDispatch(), postDispatch() or dispatchLoopShutdown() it is to late.
精彩评论