Mark this
You can do this in two ways. Way 1: It is very simple. In the above answer (the link I gave) add the following line at the end of the functionMyController
$this->load->_ci_view_path . = $this->view_type .'/';
You are done. You can just load the view, just like a regular download.
2:
, , . .
Autoload autoload.php
$autoload ['libraries'] = array ('user_agent');
config.php
$config ['enable_hooks'] = TRUE;
post_controller_constructor. hooks.php
$hook ['post_controller_constructor'] [] = array ('class' = > 'Loadview', 'function' = > 'load', 'filename' = > 'loadview.php', 'filepath' = > 'hooks' );
loadview.php hooks,
class Loadview
{
public static $MOBILE_PLATFORM = 'mobile';
public static $DEFAULT_PLATFORM = 'default';
public function load(){
$this->CI =& get_instance();
$view_type = $this->CI->agent->is_mobile() ? self::$MOBILE_PLATFORM : self::$DEFAULT_PLATFORM;
$this->CI->load->_ci_view_path = $this->CI->load->_ci_view_path . $view_type .'/';
}
}
- . , .