How to add a helper path to my index file in the portal. $ view = newZend_View (); // Zend_Controller_Action_HelperBroker: getStaticHelper ('viewrenderer'); $ view-& gt; addHelperPath ('myproject/how to add the helper path
I added index. php in the entry file
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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.