I am getting a Unable to load the requested file: default.php
error in codeigniter whenever i load up the website in a mobile device. It loads perfectly in desktop browser.
here is how my controller is set up,
class Welcome extends CI_Controller {
public function index()
{
$this->template->set_layout('default')->build('welcome_en');
}
}
Default is Sparks template i am using for the current template i am using for the "welcome_en" view page.
I have been trying to figure out this problem for a while now, there is no user agent detection script being used, there was before but i took it out in hopes of getting rid of the error.
You may need to create web and mobile folder. More info
Instead of application/views/layouts/default.php
try application/views/web/layouts/default.php
and application/views/mobile/layouts/default.php
.
Same for all your other layout files, they will load the mobile version if you browse to the page with anything CodeIgniter thinks is a mobile phone (not an iPad).