1
I am trying to load bootstrap files into Codeigniter using base_url().
My autoload.php file has the following configuration
$autoload['helper'] = array('url');
In my view I put inside the head the following code.
<link rel="stylesheet" href='<?= base_url("css/bootstrap.css"); ?>'>
And in my Controller I put the following call:
$this->load->helper('url');
Any error appears? saw the source code of the page as the link is generated?
– rray
The page is looking like it’s not loading css. I copied the css, js and font folders to my project root and when displaying the source code the url is looking like this: <link rel="stylesheet" href="localhost:8084/ci/css/bootstrap.min.css">
– fabricio_wm
base_url() .'css/bootstrap.css'
if tantar like this has the same result? ci is the name of the project?– rray
That, @rray. CI is the name of the project and the result was the same.
– fabricio_wm
In the config folder, change the config.php file on that line to:
$config['base_url'] = '/ci/';
That should eliminate thelocalhost:8084
of the url.– rray
I already put together an answer.
– rray