Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Thanks to Catfish on Stackoverflow - see http://goo.gl/5N17r
- // /ci_starter/application/core/MY_controller.php
- if (!defined('BASEPATH'))
- exit('No direct script access allowed');
- class MY_Controller extends CI_Controller {
- protected $theme;
- protected $debug;
- protected $clean_output;
- public $subdomain = null;
- public function __construct() {
- parent::__construct();
- $url = $_SERVER['HTTP_HOST']; // Get the domain. EX: www.foo.example.com
- $host = explode('.', $url);
- $subdomain = $host[0];
- $this->subdomain = $subdomain;
- $this->layout->set_layout_dir('views/themes/' . $this->theme . '/layouts/');
- $layout_file = (!$this->mobiledetection->isMobile()) ? 'layout' : 'mobile_layout' ;
- $this->layout->set_layout($layout_file);
- if(!$this->clean_output){
- $this->layout->disable_clean_output();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement