I'm building an application that has multiple domain names linked to it and different front-end views/websites based on and linked to those domain names.
Now I would like to set some variables based on the domain name and make them usable in my controllers and application logic.
for example, all views for the different front-ends are stored in different folders based on the domain name (ziv, dbg, dbe). So let's say, if a user reaches the application via example.com a variable must be set so that the views loaded will be from the folder "exm". It would look like this:
View::make('frontend.' . $folderVariable . '.home')->with('info', $info);
My question is: where should I place such code?
Should it be in the bootstrap file, or in a base controller that all other controllers will inherit? I do need the information on the domain name throughout the whole application, so it needs to be loaded up front.
Thanks in advance!
App:before()located at/app/filters.php. UseView::share()to have it available throughout the views orConfig::set()to have it available everywhere.