I am new to CodeIgniter. I am getting this problem.
Unable to load the requested file:
http://localhost/grf_new/index.php/reservation/details/34/.php
the code looks like this
$this->load->view(base_url().index_page().'/reservation/details/'.$userid.'/', $data);
Codeigniter Documentation: http://ellislab.com/codeigniter/user-guide/general/views.html
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:
<?php
class 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With