douxianwu2221 2012-06-15 20:44
浏览 44
已采纳

Codeigniter无法在移动设备中加载所请求的文件

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.

  • 写回答

1条回答 默认 最新

  • douzhang2092 2012-06-19 17:49
    关注

    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).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动