Welcome Guest, Not a member yet? Register   Sign In
Need guide to add Bootstrap in CodeIgniter?

I have created a website using CodeIgniter and MySQL to display results on a page. Now, I want to enhance the appearance of all the pages, and many sources suggest using Bootstrap for this purpose. However, I have been unsuccessful in integrating Bootstrap into my CodeIgniter project.

Could anyone recommend an up-to-date guide that I can follow to successfully implement Bootstrap into my CodeIgniter project?

Thank you in advance for your assistance.

In my CI3 environment I created a folder called static and added bootstrap in a folder below that.
As I am using HMVC, I load bootstrap in my main page like this:
PHP Code:
<link rel="stylesheet" href="<?= base_url (); ?>static/bootstrap/css/bootstrap.css"

This way the bootstrap css is loaded on every page.

public ( public_html - path in spark needs changing if moved! )
---- assets
-------- bootstrap
------------ css
------------ js
-------- css
-------- js
-------- jquery
<html  lang="<?= $locale ?>">
<link href="<?= base_url('assets/bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
<link href="<?= base_url('assets/bootstrap/css/bootstrap-icons.css');?>" rel="stylesheet">


<!-- jQuery and js here for faster page loading. -->
<script src="<?= base_url('assets/jquery/jquery-3.7.0.min.js');?>"></script>

<!-- Bootstrap JS -->
<script src="<?= base_url('assets/bootstrap/js/bootstrap.bundle.min.js');?>"></script>

What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

You can find an implementation of Bootstrap 5 used as a swappable admin template on this GitHub Repo:

CodeIgniter Wizard (CRUD code generator for Mac) instantly scaffolds Bootstrap-based web applications with an administrative interface (admin templates include Bootstrap5)


Theme © iAndrew 2016 - Forum software by © MyBB