How to add a helper path to my index file in the portal. $ viewnewZend_View (); Zend_Controller_Action_HelperBroker: getStaticHelper (ViewRenderer); $ view-& gt; addHelperPath (MyprojectViewHelper, how does Myproj add the helper path?
I added index. php in the entry file
$ View = new Zend_View ();
// Zend_Controller_Action_HelperBroker: getStaticHelper ('viewrenderer ');
$ View-> addHelperPath ('myproject/View/Helper ', 'myproject _ View_Helper ');
Why not?
Under library/Myproject/View_Helper/, I created a new one:
Require_once 'zend/View/Helper/Abstract. php ';
Class Myproject_View_Helper_RenderMenu extends Zend_View_Helper_Abstract
Tip:
Exception 'zend _ loader_pluginloader_exception' with message 'In in by name' RenderMenu 'was not found in the registry; used paths: Login_View_Helper _:.. /application/login/views \ helpers/Zend_View_Helper _: Zend/View/Helper/'In D: \ zendstudioworkspace \ zendtest \ library \ Zend \ Loader \ PluginLoader. php: 412 Stack trace: #0 D: \ zendstudioworkspace \ zendtest \ library \ Zend \ View \ Abstract. php (1182): Zend_Loader_PluginLoader-> load ('rendermenu ') #1
Where is the error? Why not search for 'myproject/View/Helper 'in the directory?
------ Solution --------------------
Put the simplest method under/views/helpers/because it is automatically included.
Or start with Zend_View_Helper _, because this is the default namespace.
The main cause of the error is that the namespace is not specified. Therefore, if you want to customize it, you need to register it. In the configuration file or with autoloader.
Http://blog.csdn.net/mengxiangbaidu/article/details/7479332
Http://blog.csdn.net/mengxiangbaidu/article/details/7191723