Need help? Call Us :
02642-266340
Email :
info@kingsoftware.co.in
×
Home
Web Development
SEO
Digital Marketing
E-Commerce
About
Company
Portfolio
Vacancy
Inquiry
Faq
Online Payments
Gallery
Contact
Blogs
COVID-19
Blog
home
Setup of HTML template into Codeigniter
27 feb 2021
Created By : Bhavesh Gohil & Vicky Parekh
codeigniter, html
HOW TO SETUP HTML TEMPLATE IN CODEIGNITER?
STEP 1: Create a new folder:
Create a new folder for your project and paste the
Codeigniter
files in this project folder
STEP 2: Make source folder:
Create a new folder as
source
folder in the
Codeigniter folder.
Copy and paste original template in this source folder.
STEP 3: Setup of config file:
Go to
application/config
folder and open
config.php
file.
Then go to line no.26 which shows
$config['base_url'].
Set the path of your folder in this variable as shown in the image and save the file.
STEP 4: Setup of routes file:
Go to
application/config
folder and open
routes.php
file.
Then go to line no.52 which shows
$route['default_controller'].
By default the controller is already set with the
Welcome
controller.
Change the controller name with the one that you want to create.
STEP 5: Setup of database file:
Go to
application/config
folder and open
database.php
file.
You can see the
Codeigniter database
file as below:
You can change username, password and database details that you created for the project in this file as shown below:
STEP 6: Make an assets folder:
Make a new folder in
Codeigniter
folder and named it as an
assets
folder.
Go to
source
folder that you created earlier and copy the
css, js, images, fonts
files.
Then paste the files in the assets folder as shown in the image below:
STEP 7: Make a common folder:
Make a new folder in
application/views/
folder. Name this folder as
common
In this
common
folder, create files that are common in all the webpages of your website like
head, header, footer, script.
In
head.php
file, add the the
head tag
code like
title, description, style sheets to be called,
etc.
In
header.php
file, add the
header tag
code like
menu, categories, search, social, etc.
In
footer.php
file, add the
footer tags
code like
footer menu, address details, etc.
In
script.php
file, call the
script files
as shown in the image below:
STEP 8: Make a controller file:
Go to
application/controllers
folder.
Make a new controller file in this folder as shown in the image below:
STEP 9: Make a view file:
Go to
application/views
folder.
Make a new view file that you want to call from the controller that you created.