Unable to load the requested file error in codeigniter Unable to load the requested file error in codeigniter codeigniter codeigniter

Unable to load the requested file error in codeigniter


Codeigniter Documentation: http://ellislab.com/codeigniter/user-guide/general/views.html

Loading a View

To load a particular view file you will use the following function:

$this->load->view('viewfile', $yourdata);

Where viewfile is the name of your view file. Note: The .php file extension does not need to be specified unless you use something other than .php.

Now, open the controller file you made earlier called blog.php, and replace the echo statement with the view loading function:

<?phpclass Reservation extends CI_Controller {    function details($id)    {        $this->data['user_info'] = $this->user_model->getUser($id)->result();        $this->load->view('userdetails', $this->data);    }}?>

If you visit your site using the URL you did earlier you should see your new view. The URL was similar to this:

example.com/reservation/details/34


Don't add base_url()

Load files using this

$this->load->view('test/test', $data);

create a file in view folder if your folder like this

application/viewstest/test.php//---------------------//If you want to read the URL use file_get_contents() function


This should work (doesnt test) :

$this->load->view('reservation/details/'.$userid, $data);