• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling multiple header/footer template and setting in route

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';


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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