无法加载请求的文件错误-Codeigniter [英] Unable to load the requested file error - codeigniter

查看:66
本文介绍了无法加载请求的文件错误-Codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在codeigniter中,我收到此消息:

In the codeigniter I get this message :

Unable to load the requested file: home.php

控制器:

cp/
    Login 


观看次数:


views :

cp/
    home.blade.php


class Login extends BaseController {
    public function __construct(){
        parent::__construct();
    }

    function index()
    {
        $this->load->view('home','');
    }

}

或:

class Login extends BaseController {
    public function __construct(){
        parent::__construct();
    }

    function index()
    {
        $this->load->view('cp/home','');
    }

}

http://www.vitrinsaz1.ir/Mobile/Vitrinsaz/Pannel/cp/login

推荐答案

在加载视图时,请记住要确保正确命名,就像在您的实例中一样,可以执行以下操作:

Hi when loading views remember to make sure that you name it correctly like in your instance you could do the following:

    function index()
{
    $this->load->view('home_blade');
}

删除文件名中的句点,并用下划线替换,然后确保视图文件本身名为home_blade.php

remove the period in the name of the file and replace it with a underscore and then make sure the view file itself is named home_blade.php

这篇关于无法加载请求的文件错误-Codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆