Welcome Guest, Not a member yet? Register   Sign In
remove header and footer for one partcular page in php codeigniter
#1

I want to remove header and footer for one particular page (landing page from another resource)  in php codeigniter.

both header and footer display how to solve this?
Reply
#2

I'll tell you how I do that, but there are more possibilities.
I have a MY_Controller in the application/core folder. https://www.codeigniter.com/userguide3/g...controller

In this controller I have a method called render_page:

PHP Code:
protected function render_page($view,$data='',$template='default')
{
 
$this->load->view('templates/' $template '/header');
 
$this->load->view($view,$data);
 
$this->load->view('templates/' $template '/footer'); 


In the views folder, I have a subfolder called templates, with this structure:
default
special

In all my controllers, I load the header and footer like this, with the default template:
PHP Code:
$this->render_page('news',$data); 

If I want to load a page with the special template:
PHP Code:
$this->render_page('external_news',$data,'special'); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB