Am trying Elisa Labs CodeIgniter tutorials. But am stuck with the first lesson itself. Ref: https://www.codeigniter.com/user_guide/tutorial/static_pages.html
As mentioned in the code I've created the controller and view. But I'm not able to view them in the browser as localhost/index.php/pages/view . I get 404 error. I'm using Bitnami WAMP. I get the default codeignitor welcome page at localhost. How can I access the newly created controller and view?
Please can any one help me with this?
More Details.
Content of C:\Bitnami\wampstack-5.4.25-1\frameworks\codeigniter\conf\httpd-prefix.conf
# Alias /codeigniter/ "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/htdocs/"
# Alias /codeigniter "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/htdocs"
# Alias /test "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/htdocs"
# Alias /test/ "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/htdocs"
DocumentRoot "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/htdocs"
Include "C:\Bitnami\wampstack-5.4.25-1/frameworks/codeigniter/conf/httpd-app.conf"
Content of C:\Bitnami\wampstack-5.4.25-1\frameworks\codeigniter\application\controllers\pages.php
class Pages extends CI_Controller {
public function view($page = 'home')
{
if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
}