CodeIgniter Forums
Controller for header,footer and sidebar - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forum-10.html)
+--- Thread: Controller for header,footer and sidebar (/thread-68673.html)



Controller for header,footer and sidebar - ktmonty - 08-11-2017

How to create separate controllers for header,footer and sidebar so i can perform operations on it?


RE: Controller for header,footer and sidebar - Wouter60 - 08-11-2017

Please, read the CI documentation about controllers, views and models. In that order.


RE: Controller for header,footer and sidebar - rtenny - 08-11-2017

Please use the tutorial and recreate the demo app.
Its a great start and explains all the steps you need to know. It took me only 30min and after that everything was nice and easy

Tutorial


RE: Controller for header,footer and sidebar - chaxvier07 - 11-04-2017

why dont u use the header footer on views? so u can call it the view, it doesn't need to make a new controller.


RE: Controller for header,footer and sidebar - XtreemDeveloper - 12-20-2017

You can manage header, footer, sidebar by method calling.

class Blogs extends CI_Controller {

function __construct() {
Parent::__construct();
}

public function index() 
{
$output['main_page'] = array();
$this->load->view('front/includes/header', $output); //Load header
$this->load->view('front/blogs/index'); //Load middle content of page
$this->load->view('front/includes/footer'); // Load footer
}

}