CodeIgniter Forums
Bootstrap - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Bootstrap (/showthread.php?tid=73921)



Bootstrap - david kariuki - 06-25-2019

Hello guys
i need some help with my Code Igniter
so its refusing to load up boot strap
even after use of the url helper
here is the code

on the view:
<link href="<?php echo base_url(); ?>/asset/css/bootstrap.css" rel=" stylesheet">

on the config file at autoload.php:

$autoload['helper'] = array('url');

Thank you


RE: Bootstrap - website - 06-25-2019

link to css is 100% correct?
try to load url helper directly in controller:
$this->load->helper('url');


RE: Bootstrap - php_rocs - 06-25-2019

@david kariuki,

What is <link href="<?php echo base_url(); ?>/asset/css/bootstrap.css" rel=" stylesheet"> outputting in the view?


RE: Bootstrap - hipm - 06-25-2019

(06-25-2019, 02:36 AM)david kariuki Wrote: what displays in the browser?



RE: Bootstrap - InsiteFX - 06-25-2019

Take off the slash / in front of asset/css/bootstrap.css

PHP Code:
<link href="<?php echo base_url('asset/css/bootstrap.css'); ?>" rel="stylesheet"

Try that.


RE: Bootstrap - Mekaboo - 06-25-2019

(06-25-2019, 02:36 AM)david kariuki Wrote: Hello guys
i need some help with my Code Igniter
so its refusing to load up boot strap
even after use of the url helper
here is the code

on the view:
<link href="<?php echo base_url(); ?>/asset/css/bootstrap.css" rel=" stylesheet">

on the config file at autoload.php:

$autoload['helper'] = array('url');

Thank you

You dont really have to anchor, just create a basic stylesheet link and make sure to place the asset folder in the root directory. That worked for me Smile


RE: Bootstrap - Wouter60 - 06-25-2019

You have a space in rel=" stylesheet". Remove it and see if that works.
Besides the bootstrap css, you also need to load jquery and the bootstrap js (javascript).
I have a folder named "assets", with a subfolder named "bootstrap". That folder contains all javascript, css and other files needed for bootstrap. You must keep the bootstrap folder structure intact.