How to Create Header/Footer and Navigation in Codeigniter

Dear Reader in This Tutorial let us We Know that “How we can Create Header/Footer and Navigation with Bootstrap”, So in this Tutorial, We Learn Step By Step Header/Footer and Navigation Process.

In Every Website or Blog Header and Footer are very important part, So we need to Create Header and Footer, If we don’t create header and footer then we have many problems like we need to write same code in every file of project and if we require modification in header or footer portion then we require to change in every file, similarly if we create Header and footer and we link that Header and footer we need only change header and footer file and link that files in every file, so in this situation we prevent redefine same code again and again.

Navigation is also very important Factor in every website and blog which is required to link all pages, so we easily move one location to another location.

We assumed that you have already Configure Codeigniter if you don’t Configure Codeigniter don’t worry you need to Configure Codeigniter first here

How to Install CodeIgniter Framework in Windows Operating System   

After Configuration CodeIgniter lets start to Create Header/Footer and Navigation ..

Step 1:- At First Create Home.php Controller in your project location

your_project_name\application\controllers

like

ci_demo\application\controllers

and paste the below code in Home.php Controller

Step 2:- After Creation of Controller Create header.php and footer.php view files in your project location

your_project_name\application\views

like

ci_demo\application\views

Create header.php(view file)  and paste the below code

Create footer.php(view file)  and paste the below code

Step 3:- After Creation of View files Create style.css CSS file in your project location

your_project_name\assets\css

like

ci_demo\assets\css

Create style.css(css file)  and paste the below code

Step 4:- After Creation of CSS file Create home.php view file in your project location

your_project_name\application\views

like

ci_demo\application\views

Create home.php(view file)  and paste the below code

Step 5:- Now open your browser run project as

your_project_name/home

like

localhost/ci_demo/home

Congratulations you have created Header and Footer with Bootstrap Navigation as you can see in below snapshot

how-to-create-header-Footer-and-navigation-in-codeigniter

If you have any query then Contact Us or comment below, Thanks

 

«
»

Leave a comment:

Your email address will not be published. Required fields are marked *