Zend Framework - 具有模块前缀的类继承(Zend Framework - Class Inheritance with Module Prefix)
我正在使用PHP和Zend Framework实现一些代码并使用模块。 我在
application.ini
设置了以下行:resources.frontController.prefixDefaultModule = "true"
所以我在
admin
模块中的控制器类被命名为Admin_{class name}
现在,我正在尝试使用一些继承
class Admin_IndexController extends Admin_BaseController
但我总是得到相同的错误信息:
Warning: include_once(BaseController.php): failed to open stream: No such file or directory in C:\xampp\php\pear\Zend\Loader.php on line 146 Warning: include_once(): Failed opening 'BaseController.php' for inclusion (include_path='.;\xampp\php\PEAR;..\library;..\library\Carrinho;..\application;..\application\models;..\application\modules;..\application\plugins') in C:\xampp\php\pear\Zend\Loader.php on line 146 Fatal error: Class 'BaseController' not found in C:\xampp\htdocs\SiteSermap\application\modules\admin\controllers\IndexController.php on line 3
Obs。:我已经尝试过使用它(没有“Admin”前缀)
class Admin_IndexController extends BaseController
有谁知道如何解决这个问题?
I'm implementing some code with PHP and Zend Framework and working with modules. I set in my
application.ini
the following line:resources.frontController.prefixDefaultModule = "true"
So my controller classes in
admin
module are named likeAdmin_{class name}
Now, I'm trying to use some inheritance like
class Admin_IndexController extends Admin_BaseController
But I always get the same error message:
Warning: include_once(BaseController.php): failed to open stream: No such file or directory in C:\xampp\php\pear\Zend\Loader.php on line 146 Warning: include_once(): Failed opening 'BaseController.php' for inclusion (include_path='.;\xampp\php\PEAR;..\library;..\library\Carrinho;..\application;..\application\models;..\application\modules;..\application\plugins') in C:\xampp\php\pear\Zend\Loader.php on line 146 Fatal error: Class 'BaseController' not found in C:\xampp\htdocs\SiteSermap\application\modules\admin\controllers\IndexController.php on line 3
Obs.: I've already tried using this (without "Admin" prefix)
class Admin_IndexController extends BaseController
Does anyone know how to solve this?
原文:https://stackoverflow.com/questions/21936898