Kohana PHP - Multiple apps with shared model

Posted by Josamoto on Stack Overflow See other posts from Stack Overflow or by Josamoto
Published on 2010-05-20T06:46:16Z Indexed on 2010/05/20 7:00 UTC
Read the original article Hit count: 334

Filed under:
|
|
|

I'm using Kohana 3 to create a website that has two applications, an admin application and the actual site frontend. I have separated my folders to have the two applications separated, so the hierarchy looks as follows:

/applications
    /admin
        /classes
        /controller
        /...
    /site
        /classes
        /controller
        /....

My question is, how I need to go about creating a shared /model folder. Essentially, both the admin and site itself operates on the same data, so the database layer and business logic remains more or less the same. So to me, it makes sense to have a single model folder, sitting outside of the two application folders. Is it possible to achieve the following hierarchy:

/applications
    /model --> Where model sits in a neatly generic location, accessible to all applications
    /admin
        /classes
        /controller
        /...
    /site
        /classes
        /controller
        /....

Thanks in advance!

© Stack Overflow or respective owner

Related posts about php

Related posts about kohana