开发者

Class extending Zend_Controller_Action, not found by Zend Tool

I created an class extension of Zend_Controller_Action and added some user defined methods, which will be accessed from any controller so forth.

Every thing is working fine, until I use Zend Tool to create a new Action, as this time The Zend tool will not find out my extended class.

Error Message:

Fatal error: Class 'CMS_Zend_Controller_Action' not found in....

That is the class which extends Zend_Controller_Action and the one extended by other controllers like indexController.

How开发者_JAVA百科 to make the class discoverable. Do I have to include each and every folders, like my classes are? Does zend does that? I dont think so. How does it do it?


Simple. :-p If it can find your core controllers, then you just need to include the path to your extended controllers.

http://php.net/manual/en/function.set-include-path.php

set_include_path(path_to_your_extended_classes) in your index.php, aka routes file.


I think what you are trying here is not what Zend_Tool is about.

As much as I understand your question and setup you have created a class in your library. Of course, you can extend Zend_Controller_Action with lots of your own classes in your own library/libraries (I do that, too). Adding an action to such a class is maybe unusual but a problem for Zend_Tool for one specific reason.

Zend_Tool I believe is only about the well known structures like /application and same for what is inside /modules. If you create a Controller Class Zend_Tool will do some work for you like adding required folder structure to your /application or /modules folder. Same with action method which require view files. Having a Controller Class in your library does not (should not) need all that and hence is not build into Zend_Tool. I think whatever class you create in your library is not supported in Zend_Tool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜