()
| 3 | class Theme_example extends CI_Controller { |
| 4 | |
| 5 | public function __construct() |
| 6 | { |
| 7 | parent::__construct(); |
| 8 | |
| 9 | //load helpers |
| 10 | $this->load->helper( array('url', 'cookie')); |
| 11 | |
| 12 | //load theme spark |
| 13 | $this->load->spark('theme/1.0.0'); |
| 14 | |
| 15 | //try to get the theme from the cookie |
| 16 | $theme = get_cookie('theme'); |
| 17 | if (in_array($theme, array('default', 'skeleton'))) |
| 18 | { |
| 19 | //got a valid theme... set it |
| 20 | $this->theme->set_theme($theme); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | public function index() |
| 25 | { |