0

I paste bootstrap folder inside my CodeIgniter folder and added it to my config.php.

$config['bootstrap'] = 'bootstrap-3.3.5-dist/css/bootstrap.css';

and call it to my php script(view).

$bootstrap = $this->config->item('bootstrap'); 
 <link rel="stylesheet" type="text/css" href="<? echo "$base/$bootstrap";?>">  

But still I getting a 404 error.

r.paul Ǿ
  • 111
  • 1
  • 2
  • 11

2 Answers2

0

Assuming that $base is previously defined (usually with base_url() how to set base_url). Change this:

href="<? echo "$base/$bootstrap";?>"

To this:

href="<?php echo "$base/$bootstrap";?>"

Or alternatively, if you want to use short tags:

href="<?= "$base/$bootstrap";?>"
Community
  • 1
  • 1
CodeGodie
  • 12,116
  • 6
  • 37
  • 66
0

First make sure you autoload the url helper.

<link rel="stylesheet" type="text/css" href="<? echo "$base/$bootstrap";?>"> 

Replace With

<link rel="stylesheet" type="text/css" href="<?php echo base_url(config_item('bootstrap'));?>">

Also make sure bootstrap-3.3.5-dist folder is in Main Directory