Developing a multiple site application |
[eluser]Unknown[/eluser]
My pet project currently is based in offering a web application that manages soccer leagues. At this moment I can handle one league, that is ONE "client". That said I need to handle different server_urls for each client (multiple leagues, multiple clients) that can have their own personalized (css and images) look. www.soccerleague1.com www.soccerleague2.com www.soccerleague3.com ... My approaches: 1) Have multiple CI for each league (not quite interested in this option, lot of work to maintain) 2) Have one CI installation and handle a leages table in the DB. About this option, I think I will add the league_id to every other table (like matches, teams, etc). Questions about option 2: 2.1) Wich would be the better way to handle the multiple sites (session, globals)? I mean, I need to get the server_url then get the league associated and then do the correspondent querys. My guess is to do something like this (hook that loads pre_controller): Code: class Hook { or Code: class Hook { I think the first approach is the correct one cause it defines a different variable (through session) to each user. The second one would change a global variable (config item) every time a request to a controller is done. 2.2) Is there a way to do this without using sessions? (Extending the controller maybe? but the counterpart would be repeating the query everytime against the DB). I hope I explained myself good enough. Thanks!
[eluser]2think[/eluser]
If you use option #2 which I think is better than multiple sites, why not use the URI Class to direct the users to a specific page?
[eluser]n0xie[/eluser]
Why use an Hook? Might as well use a base controller which sets in which 'league' you are. Code: //pseudo code |
Welcome Guest, Not a member yet? Register Sign In |