【问题标题】:How can I use "HMVC" in kohana phpframework?如何在 kohana phpframework 中使用“HMVC”?
【发布时间】:2012-07-25 08:19:23
【问题描述】:

我有一个项目想使用kohana框架,这个项目的组成如下:

test1(这是我项目中的一个模块)
课程
控制器
型号
意见

test2(这是我项目中的另一个模块)
课程
控制器
型号
意见

....更多

我想要这样的网址:
http://example.com/test1/controller/action/...
http://example.com/test2/controller/action/...

我该怎么做?

【问题讨论】:

标签: php kohana hmvc


【解决方案1】:

您可以使用基本的 Kohana 结构,但使用两个应用程序文件夹而不是一个:

test1
    application
    index.php
test2
    application
    index.php
modules
system

test1 和 test2 都将共享模块和系统目录。

然后确保更新 index.php 中的应用程序、模块和系统路径。

【讨论】:

    【解决方案2】:

    我会选择做两个网站: /var/www/sites/site1/ 和 /var/www/sites/site2/

    然后将模块和系统目录设置为 /var/www/kohana/system 和 /var/www/kohana/modules 只需将 bootstrap.php 中的 SYSDIR/MODDIR 变量更改为相应的目录。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-26
      • 2011-09-03
      • 2012-05-12
      相关资源
      最近更新 更多