Welcome Guest, Not a member yet? Register   Sign In
Multiple applications on single CI install
#1

[eluser]Unknown[/eluser]
I've been fiddling around with the idea of setting up a site with multiple apps. I.e., I'd have a 'Main' app, a 'blog' app, 'forum', and so on. Each app would have its own controllers, models, and libraries, as well as access to global libraries & models directories.

Directory structure is currently like this:


Code:
root
/applications
  /libraries (global)
  /models (global)
  /main (default app loaded when going to www.domain.com)
    /config
    /controllers
    /errors
    /helpers
    /hooks
    /language
    /libraries
    /models
    /views
  /blog  (would be reached through www.domain.com/blog/)
    /config
    /controllers
    /errors
    /helpers
    /hooks
    /language
    /libraries
    /models
    /views
  /forum  (see above)
    /config
    /controllers
    /errors
    /helpers
    /hooks
    /language
    /libraries
    /models
    /views
/htdocs
  /images (global images used across templates)
  /js  (global scripts)
  /style (global css)
  /templates
    /default
      /images
      /js
      /style
    /blog
      /images
      /js
      /style
    /forum (you get the idea)
/libraries
   /codeigniter
   /any other libraries I might use
/logs

Now, everything is setup this way and works fine, except that I need a way for codeigniter to recognize that when a user types in www.domain.com/blog or /forum, it switches apps. Is this possible?

Edit: I should also clarify just in case, the htdocs folder and subfolders are the only publicly accessible folders. Everything else is below the webroot for security reasons.
#2

[eluser]Phil Sturgeon[/eluser]
Why not just use Matchbox?

It is doing essentially what you have here, but means you don't need to set up a new application for each new section you make, and makes loading your global resources, etc much easier.




Theme © iAndrew 2016 - Forum software by © MyBB