php - Base URL error in CodeIgniter -


i new in codeigniter. in project, base url code not working properly...

in config.php:

$config['base_url'] = 'http://localhost/simpleblog/'; 

in view, is:

<link type="text/css" rel="stylesheet" href="href="<?=base_url()?>views/css/main.css" /> 

my project file structure attached in skydrive https://skydrive.live.com/redir?resid=3bff708c7026eb1b!139&authkey=!aeqsh3kwtzdu328&v=3

and error

https://skydrive.live.com/redir?resid=3bff708c7026eb1b!140&authkey=!amwgc_uwpqlezom&v=3

how solve issue?

the base_url function part of url helper. codeigniter not load helpers default, must load helpers want use.

you can either in controller you'll using function:

$this->load->helper('url'); 

or if it's helper intend use throughout site, can tell codeigniter automatically load adding $autoload['helper'] array in config/autoload.php.

btw - use case, recommend site_url() instead of base_url():

<link type="text/css" rel="stylesheet" href="<?= site_url('views/css/main.css') ?>" /> 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -