I am new to codeigniter ,
I want to redirect Login page request to this route
$route['login'] = 'TravelApi/login/';
So now http://localhost.com/codeigniter/login request should route through controller/TravelApi.php 's TravelApi class 's login() function.
Controller
public function login(){
$contents['login_url'] = $this->googleplus->loginURL();
$this->load->view('frontend/login',$contents);
}
My question is :
When request routes through above controller and then goes to frontend/login.php -- login.php file gets loaded but without header and footer.
But when I remove this route from config/routes.php
$route['login'] = 'TravelApi/login/';
then request does not route through controller and directly goes to frontend/login.php . and here it loads login.php file with header and footer.
But my need is to route from controller. and load view file with header footer.
So why it does not load header footer when routes through my controller's function ?
EDIT:
I found a function in default controller welcome.php
public function pages($alias=NULL)
{
$page='frontend/'.$alias;
$this->load->view('frontend/common/head'); // For Head Scripts
$this->load->view('frontend/common/header', $this->common_menu('TopMenu')); // For Header Content
$this->load->view('frontend/common/menus', $this->common_menu('MainMenu')); // For Menus
$this->load->view($page);
$this->load->view('frontend/common/footer'); // For Footer Content
$this->load->view('frontend/common/foot'); // For Footer Scripts
}
But still not clear that why it does not load header footer when routes through my controller's function ?