Search code examples
phpkohanahmvc

How can I use "HMVC" in kohana phpframework?


I have a project want to use kohana framework, and the composition of this project like:

test1 (this is one module in my project)
    classes
        controller
        model
    views

test2 (this is the other module in my project)
    classes
        controller
        model
    views

....more

I want urls like this:
http://example.com/test1/controller/action/...
http://example.com/test2/controller/action/...

How can I do that?


Solution

  • You could use the basic Kohana structure but with two application folders instead of one:

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

    Both test1 and test2 would share the modules and system directories.

    Then just make sure to update the application, modules and system path in index.php.