这是我遇到的错误。
请确保在Routes.php文件中指定的控制器有效。 / p>
Please make sure the controller specified in your Routes.php file is valid.
让我解释一下。 在我的应用程序中,我使用了HMVC。在我的application文件夹中有两个文件夹back-modules和front-modules。在我的front-modules文件夹中有一个名为 home的文件夹,其中包含控制器,模块和视图。
Let me explain this. In my application i have used HMVC. In my application folder there are two folders back-modules and front-modules.in my front-modules folder there is a folder called "home" and it has controllers,modules and views.
controllers-> home.php
controllers->home.php
这是我的home.php
this is my home.php
class Home extends MX_Controller{ public function __construct(){ parent::__construct(); $this->load->helper(array('form')); } public function index(){ $this->template->build('home'); } }这是我的routes.php
and this is my routes.php
$route['default_controller'] = "home"; $route['404_override'] = '';当我尝试访问该网站时,会出现此错误
when i try to go to the site, it gives this error
无法在Codeigniter上加载默认控制器。请确保在Routes.php文件中指定的控制器有效。
unable to load your default controller on Codeigniter.Please make sure the controller specified in your Routes.php file is valid.
此系统在localhost上运行良好。
this system works fine on localhost.
请有人帮忙解决此问题。
Someone please help me in this matter.
推荐答案根据codegniter手册管理多应用程序
According to codegniter manual managing multi application
在您的index.php文件更改中
in your index.php file change
$application_folder = 'application';至
$application_folder = 'application/home';并确保控制器文件名以大写字母开头
and make sure the controller file name starts with capital letter
controllers->Home.php并保留Routes.php配置
and keep Routes.php configurations
$route['default_controller'] = "home";更多推荐
无法在Codeigniter上加载默认控制器
发布评论