Welcome Guest, Not a member yet? Register   Sign In
Bootstrap
#1

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
Reply
#2

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

@david kariuki,

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

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

(This post was last modified: 06-26-2019, 02:49 AM by InsiteFX. Edit Reason: removed space )

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

(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
Reply
#7

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB