Unable to load the requested file error - codeigniter

▼魔方 西西 提交于 2020-01-05 12:58:41

问题


In the codeigniter I get this message :

Unable to load the requested file: home.php

controller :

cp/
    Login 

views :

cp/
    home.blade.php

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

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

}

or :

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


回答1:


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');
}

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



来源:https://stackoverflow.com/questions/33452842/unable-to-load-the-requested-file-error-codeigniter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!