Welcome Guest, Not a member yet? Register   Sign In
Multiple application resources

(This post was last modified: 10-15-2015, 02:22 PM by JoellSVK.)

Hello, I would like to ask about how to handle best multiple applications resources. I intend to develop system with possible to install more apps and i wonder what could be best way to handle files like images, css, js etc. Maybe could be good way to have in one application also those resources (where are controllers, models, configs...). 

See my attachment... What do you think ?

Attached Files Thumbnail(s)

Sorry, but that's like asking "How do I get more stuff?" ... It's a meaningless question; you need to be more specific.

(10-15-2015, 06:14 PM)Narf Wrote: Sorry, but that's like asking "How do I get more stuff?" ... It's a meaningless question; you need to be more specific.

It is all about just file/folder structure. Just best practice for organizing resources (images, js, css etc... ) with multiple application. What is meaningless about it ?  Huh

It was difficult to understand what you were asking.

If you need to share resources between multiple applications, it's usually best to configure one directory to hold those resources, then configure each application to point to that directory. If you need application-specific resources, it's easiest to just add a directory named after the application inside the shared directory, but you could take the extra step of setting up individual directories along with the shared directory.

In most cases, I would setup my application something like this:
/public - index.php, assets directory containing all public files, including images, JS, CSS, and documents
/system - CI/system directory
/application - application directory

Of course, since index.php usually needs to be configured for each application, you may need several versions of this file, possibly in different locations, but you can still point to a shared location for the shared resources. You could even put application directories in your public directory to hold your index.php files and application-specific resources.

If I need shared non-public resources, I can add another directory for those and add it to the package paths in my applications or add a custom loader to load resources from multiple directories. Since I usually use Bonfire, I could place the shared code in my /bonfire directory, since Bonfire's loader is already setup to check the application, bonfire, and CI directories.

Theme © iAndrew 2016 - Forum software by © MyBB