[eluser]TheFuzzy0ne[/eluser]
Also, an observation on the code you posted. It might be wise to extend the Loader, and override the view() method. You can add a little logic in there that will automatically append '_mobile' to the end of the filename string if it's a mobile request, but only if the mobile view file exists. If not, then it can just fallback on the regular view, and if that's not available, CodeIgniter can just chuck a wobbler as normal.
I just thought it might save you from repeatedly having to type:
Code:
if ($this->agent->is_mobile()) {
$this->load->view('some/view_mobile', $data);
} else {
$this->load->view('some/view', $data);
}
Instead you'd just type:
Code:
$this->load->view('some/view', $data);
...and the rest is taken care of for you.