• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page Navigation

Am new in codeigniter.need help to fix route issues
Am building a small application with codeigniter but am having challenges with navigating from one page to another.

firstly: i have an admin called http://localhost/koeweb/dashboard which loads fine.
secondly: am trying to go to another page within the admin,say http://localhost/koeweb/dashboard/page2 and i get 404 Page Not Found.

My Route:
$route['(:any)'] = "home/$1";
$route['default_controller'] = "home";
$route['dashboard/(:any)'] = "dashboard/$1";
$route['dashboard'] = "dashboard";

My controller:

class Dashboard extends CI_Controller{
    public function __construct() {

    public function index(){
        $data['query'] = $this->parish_model->getParish();
        $this->load->view('dashboard/dashboard_view', $data);
    public function page2(){

What's your base_url set to? Also, your first route should really be the last. Routes work from top down, as soon as something matches, it will use that route. (:any) will match anything, so should be last after all other named routes.

$config['base_url'] = 'http://localhost/koeweb/';

Please how can i navigate from one page to another?

Use CI anchor see the url_helper in the Users Guide

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.