A simple way would be to use Bootstrap CDN. For CSS, simply include this line in the <head>
section of every webpage (somewhere in your view files, depending on how you have structured them):
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
To include the JavaScript:
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
Bootstrap's plugins depend on jQuery, so you'll need to include jQuery before Bootstrap's JavaScript.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Alternatively you could host the files on your web server. Upload the relevant files to a publicly accessible directory. I'm going to assume that they are in an assets folder, in your web root, like this:
- public_html
- index.php
- assets
- css
- boostrap.css
- js
- bootstrap.js
- jquery.js
(other files/directories...)
To include them in your view files, you can link them like this:
<link rel="stylesheet" href="<?php echo base_url("assets/css/bootstrap.css"); ?>">
<script type="text/javascript" src="<?php echo base_url("assets/js/jquery.js"); ?>"></script>
<script type="text/javascript" src="<?php echo base_url("assets/js/bootstrap.js"); ?>"></script>
You'll need to have loaded the URL Helper to use the base_url()
function.