Welcome Guest, Not a member yet? Register   Sign In
Multiple application with CI4
#5

(08-06-2018, 05:42 AM)Przem4S Wrote: I think about 'old' solution: segment in url like /admin but with latest CI4 that's not work property (admin segment set as controller).

Why wouldn't this work currently? It still supports automatically determining controller based on URL so should work just like CI3 did in that respect. Additionally, you can use Route groups to add a prefix to other controllers, if you're specifying all of your routes in the routes file.

(08-06-2018, 05:42 AM)Przem4S Wrote: I need structure multi-applicational like /applications/one1 (inside all Config/Controllers/Filters/Language/Models etc.) and second /applications/one2 (inside all Config/Controllers/Filters/Language/Models etc.) and maybe in future more apps.

Fairly easily done: make multiple copies of the application folder, and rename to whatever apps you have:

Code:
admin/
        Controllers/
        Models/
        etc
    clients/
        Controllers/
        Models/
        etc
    public/
        admin/
            index.php
        clients/
            index.php
    system

This is the safest way to do it, though you could make each a "flat" structure by bringing the public folder along with it.

In the Config\Paths.php file for both applications, adjust to make sure they point to the appropriate directory and the shared system directory.

Either this solution, or the one I mentioned at the top of this post work. If you want to share models, that's pretty easily done by ensuring they are namespaced and both applications know where to find them. Or, just use the route groups, mentioned above, and keep them all in a single application so models, libraries, etc don't need to be duplicated.

Lots of options. Smile
Reply


Messages In This Thread
Multiple application with CI4 - by Przem4S - 08-06-2018, 05:14 AM
RE: Multiple application with CI4 - by Przem4S - 08-06-2018, 05:42 AM
RE: Multiple application with CI4 - by kilishan - 08-06-2018, 10:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB