• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootstrap integration with Codeigniter.

This lesson will help you to understand how to integrate bootstap with Codeigniter.

First remember this is just a skelton example.

Ok..Lets go.

Step 01 :

Download Bootstrap form it's official website.

Step 02 :

Create a folder called 'assets' in /wamp/www/CodeIgniter directory[In WAMP server].
N.B CodeIgniter in above directory is the name of my project.
Unzip the above downloaded folder and copy all(css,js,fonts folders) the folders inside that folder.
Paste them inside the assets folder.

Please check that the path is correct to bootstap.


Step 03 :

Open the config.php in /CodeIgniter/application/config directory,

And edit it as

$config['base_url'] = 'http://localhost/codeigniter/';

Step 04 : Create the controller as boots.php and save belows in it.


class boots extends CI_Controller
public function getBoots()



Step 05 :

Create the view file as samplebootstrap.css and save beloes in it.

<link href="<?php echo base_url('assets/css/bootstrap.css');?>" rel="stylesheet">
<link href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>" rel="stylesheet">

<div class="container">

<?php echo form_open("boots/getBoots",'class="form-inline"'); ?>
<legend>Enter the data </legend>

<div style="margin-left:30%;margin-top:20px;" >

<div class="form-group">
<label for="employeeno" class="control-label">Employee No :</label> <input type="text" name="name" class="form-control" />


<div class="form-group">
<label for="age" class="control-label">Age :</label> <input type="text" name="age" class="form-control" />
<input type="submit" name="name" class="btn btn-primary"/>


<?php echo form_close(); ?>

Step 06 :

Now That is all go to the web browser and type


You will see a form which has applied the bootstrap.

Attached Files Thumbnail(s)
That is my style with Codeigniter Idea . Start with simple and ends in deep.

Messages In This Thread
Bootstrap integration with Codeigniter. - by Ujitha - 02-14-2015, 01:33 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.