php - CodeIgniter: Add css link -


i trying use php framework codeigniter php project. never used before. according documentation activated helper url , included css link shown below:

$autoload['helper'] = array('url');  <link rel="stylesheet"  type="text/css"  href="<?php echo base_url();?>public/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css"  href="<?php echo base_url();?>public/css/style.css"/> 

unfortunately page not able load css. if put compiled css link page able load it.

<link rel="stylesheet"  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> 

base_url() not add trailing slash. need forward slash in between php code , public in link href.

say base url /htdocs/website/, way have set print out /htdocs/websitepublic/css/style.css.

here fixed code:

<link rel="stylesheet"  type="text/css" href="<?php echo base_url();>/public/css/bootstrap.min.css"/> <link rel="stylesheet" type="text/css" href="<?php echo base_url();>/public/css/style.css"/> 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -