Thursday, February 18, 2016

How to integrate bootstrap and Codeigniter

How to integrate bootstrap and Codeigniter

We come with one of our guides and tutorials on Codeigniter we will integrate  bootstrap in Codeigniter as simply and quickly as possible.
If you've come this far you probably already know that CodeIgniter is one of the MVC (Model-View-Controller) frameworks more bullish today, meanwhile, Bootstrap, which was conducted by the team of frontends Twitter, maybe (and perhaps I get by politically correct) the best framwork for existing fronend today.
Combining both programming frameworks will be better than sex for you. Enjoy it!

What do you need

Although it is quite obvious, this is what you need to have ready to  use Bootstrap and Codeigniter together in harmony:
  • CodeIgniter installation , if you want, we show how to install codeigniter and put it to work inthis tutorial .
  • Download bootstrap 3 , on its official website .
  • jQuery . javascript library download this here .

Bootstrap Codeigniter + stepper

Step 1 - Create a directory for Bootstrap

Create a folder called "assets" (that's what you recommended, if you want to put another name) at the same level as the folder application CodeIgniter in this folder will have all the content of our Bootstrap.
Assets for Bootstrap
This is the structure that should have directories

Step 2 - Add contents

To decompress Bootstrap find three folders: css, js and fonts. As we need the jQuery library to work Bootstrap going to put the .js we downloaded jQuery within the js folder. I recommend using the minify version, load time savings ...
assets folder
That will be the assets folder

Step 3 - Add the libraries

Now we got all content, before the three folders, to the folder  assets . With this we will have almost everything ready.

Step 4 - Link from the views

The last step, we have to link the libraries from all views that want to use  Bootstrap , for it just have to include the following tag in the <head> of view.
<Link rel = "stylesheet" href = "<? Php echo base_url (" assets / css / bootstrap.css ");?>" />
<? Php echo base_url ( "assets / css / bootstrap.css" ); ?> "/>
With this call to Bootstrap CSS. 
And adding before </ body> to load the following java script functions:
<Script type = "text / javascript" src = "<? Php echo base_url (" assets / js / jQuery-1.11.3.js ");?>"> </ Script><? Php echo base_url ( "assets / js / jQuery-1.11.3.js" );  ?> "> </ Script>
<Script type = "text / javascript" src = "<? Php echo base_url (" assets / js / bootstrap.js ");?>"> </ Script>
<? Php echo base_url ( "assets / js / bootstrap.js" ); ?> "> </ Script>


Note that the Query file matches yours, in my case, the current version is 1.11.3, but when you read this may have changed.
With this, we can start using our Bootstrap Code igniter project.

Final Words

If You Need Any Kind Of Information about Blogger Contact us

pkhowto.com