|
受群里高手们鼓舞,我也来发教程
CI版本:2.1.0
HMVC扩展:wiredesignz-codeigniter-modular-extensions-hmvc-652e85cc40a3
(下载地址:https://bitbucket.org/wiredesign ... ions-hmvc/downloads)
安装
- 把压缩包里的core/MY_Loader.php 和 core/MY_Router.php 拷贝到application/core/ 下面
- 把压缩包里的third_party/MX/ 拷贝到application/third_party/ 下面
- 新建application/modules/folder1
- 新建application/modules/folder2
- 新建application/modules/folder1/controllers , application/modules/folder1/views
- 新建application/modules/folder2/controllers , application/modules/folder2/views
- 新建application/modules/folder1/controllers/foo.php
PHP复制代码
class Foo extends MX_Controller{
public function index()
{
$this->load->view("foo_message");
}
}
复制代码
- 其他同理
- 视图里可以调用另一个modules里的控制器,通过:
PHP复制代码
echo Modules::run("folder2/bar/index");
复制代码
|
评分
-
查看全部评分
|