【发布时间】:2016-04-27 18:11:47
【问题描述】:
我们使用:
PHP5.6.14
WINDOWS 7
Codeigniter 3.0.6
[Codeigniter HMVC][1]
我们的项目结构:
application
----modules
--------auth
------------controllser
------------models
------------views
--------input
------------part1
----------------controllers
--------------------Part1.php
----------------models
----------------views
--------------------index.php
------------part2
----------------controllers
----------------models
----------------views
--------othermodule
------------controllser
------------models
------------views
在 application/config/config.php 我们添加
$config['modules_locations'] = array(
APPPATH.'modules/' => '../modules/',
APPPATH.'modules/input/' => '../modules/input/',
);
应用程序/模块/输入/part1/Part1.php
class Part1 extends MX_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->view('index');
}
}
在 application/config/routes.php 我们没有改变任何东西
.htaccess
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
当http://musite.ru/part1 我们看到错误:
An Error Was Encountered
Unable to load the requested file: index.php
可能是什么问题?
【问题讨论】:
-
查看页面 roytuts.com/setup-hmvc-with-codeigniter-3/
标签: codeigniter hmvc