Welcome Guest, Not a member yet? Register   Sign In
How would you do this?
#1

[eluser]jnorris441[/eluser]
I am creating an online store system that will run many sites.

The approach I initially thought of was to keep the store core somewhere, and extend CI's Loader to use the core classes UNLESS there are classes specific to a certain site available.

Or maybe I could use routes to remap /category/view/1 to /mycoolstorecategory/view/1, so that I can have a mycoolstorecategory controller that extends the core category controller.

I'm already holding the views paths in an array that I can change per site, so that part is taken care of I guess.

How would you construct your app so that it can be easily upgraded but also customize the controllers and views per site?
#2

[eluser]chobo[/eluser]
It seems you are going for an inheritance type structure where you derive other stores from a base store. You could look into modular separation (just do a search for it), I haven't really looked much into it, but it would allow you to separate the content and share the system folder. You could go with my current solution which is create separate folders within the application folder to separate distinct subsites, you will need to update your app path, and you will need a separate front controller for each subsite (it's fast and dirty and it's ok if you only have a few subsites)

Ex structure:

Application
Site1
....controller (and all the other stuff normally found in application folder)
Site 2
... same as above

For loading your core classes I don't see why you can't just those libraries in the autoload file.




Theme © iAndrew 2016 - Forum software by © MyBB