CodeIgniter Forums

Full Version: Calling multiple header/footer template and setting in route
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone
I am new to codeigniter and want to use it for a fairly large project. I intend to use two different bootstrap template.
The first one is working but I don't understand why the second is'nt.
below is the controller code
PHP Code:
    class Pages 
extends CI_Controller{
     public function view($page 'home'){
       $data['title'] = ucfirst($page);

     public function iview($page 'volunteers'){
       $data['title'] = ucfirst($page);
Below is the change I made in the application/config/routes.php

Quote:$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';
$route['ipages/(:any)'] = 'ipages/iview/$1';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
@ chized
Are you receiving any error messages?
In your second function. The if condition. Should it be checking for 'iviews/ipages/' instead of 'views/ipages/'? There seems to be a discrepancy between the function and the routes.
Try change it:

Quote:$route['ipages/(:any)'] = 'ipages/iview/$1';

to it:

Quote:$route['ipages/(:any)'] = 'pages/iview/$1';