S.M_Emamian
S.M_Emamian

Reputation: 17383

Unable to load the requested file error - codeigniter

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

Upvotes: 1

Views: 3619

Answers (3)

Dan Ruiyot
Dan Ruiyot

Reputation: 11

If the code is correct and you still experiencing that error, change folder permissions :

chmod -R 777 "your folder"

I had a similar problem and that solved it.

Upvotes: 0

Muhammad Usman
Muhammad Usman

Reputation: 148

Hey there I was also encountered by this error and my error was solved by rechecking the parent folder name try replacing cp.

 $this->load->view('cp/home');

with this

 $this->load->view('Cp/home');

I think this could be the issue.. My code was working fine on localhost but on server it wasn't loading the view. my error was solved by this.

Upvotes: 0

RiaanV
RiaanV

Reputation: 258

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

Upvotes: 2

Related Questions