用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3069|回复: 6
收起左侧

[讨论/交流] 请问HEX的HMVC如何实际运用?

[复制链接]
发表于 2010-7-13 12:59:37 | 显示全部楼层 |阅读模式
1)下载1.7.22)把HEX的HMVC的内容拷贝到application中
3)输入 http://localhost/ci/
显示结果:
Welcome to CodeIgniter!
The page you are looking at is being generated dynamically by CodeIgniter.
If you would like to edit this page you'll find it located at:system/application/views/welcome_message.php
The corresponding controller for this page is found at:system/application/controllers/welcome.php
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

Page rendered in 0.0474 seconds
Folder_Test_Main_data_modelfolder/test/views
Test2_Main_data_modeltest2/views

但是我输入http://localhost/ci/test2
Not Found
The requested URL /ci/test2 was not found on this server.

实在不明白这个HMVC的作用是什么以及怎么运用?
发表于 2010-7-13 18:27:14 | 显示全部楼层
什么是 HMVC 楼主应该先 google 一下。
实际上就是一种 Module,有点像“控件”的概念,就是每个模块都有自己的 MVC 结构,可以把模块放到任何的视图里。
 楼主| 发表于 2010-7-13 21:32:47 | 显示全部楼层
回复 2# Hex


   这我当然知道,我只是奇怪怎么也输不出你程序的结果,比如;http://localhost/hmvc/index.php/test2,404;http://localhost/hmvc/index.php/test2/home_made/,404.......见谅了。
发表于 2010-7-14 09:44:55 | 显示全部楼层
结果?你要什么结果?那只是个例子。
Module 本身不能通过 URL 访问。
发表于 2010-7-14 10:14:57 | 显示全部楼层
是在视图里调用的.
 楼主| 发表于 2010-7-14 12:58:13 | 显示全部楼层
回复 4# Hex


   是这样的,在ZF中的module中的URL是这样访问的:http://localhost/web/moudlename/controllername/methodname。因此我认为你这个扩展也应该类似的,所以我就直接在浏览器里面输入http://localhost/ci/test2/home_made/index。。。。。。
看来我还是不理解HMVC?
发表于 2010-7-14 13:05:46 | 显示全部楼层
Module 可以通过 URL 访问,那和控制器有什么区别?
控制器直接分目录不就完了吗?呵呵

本版积分规则