[eluser]cescopag[/eluser]
[quote author="Jelmer" date="1224968638"]Hey Blue Sapphire,
I don't allow my users to do it, so I don't have any tips on that front. But in my system the site administrator can switch between designs. The way I allow for multiple designs is by putting every design in its own folder and name the views the exact same way (or at least the wrapper that loads any other stuff):
Code:
views/template 1/wrapper.php
views/template 2/wrapper.php
views/template 3/wrapper.php
and then load your view by:
Code:
$this->load->view($user_prefs['template'].'/wrapper', $data);
Now just figure out how to save/load the $user_prefs and your systems allows for multiple themes...[/quote]
I've done something similar. I have a splash screen where the user can choose the theme, then I store it in the session data. I've made a custom function within my main controller that I use to load each view:
Code:
function __loadView($view, $data = array(), $render = FALSE) {
if ($this->session->userdata('theme')) {
$theme = $this->session->userdata('theme');
} else {
$theme = 'default';
}
return $this->load->view($theme.'/'.$view, $data, $render);
}
In my controller instead of using $this->load->view(...) I just use $this->__loadView(...)