css - CodeIgniter - Simple base_url question -


I'm a little confused.

I have a simple controller that loads a view. There is a form in the view and links to some CSS files. I really do not want to do ../../ css / global.css in my link tag. I want to use the base_url () method and then go / css /

I know that a friend uses the following:

  & lt; Link href = "{base_url} css / style.css" rel = "stylesheet" type = "text / css" /> However, I can not get it to work, that uses CodeIgniter 1.7, however, I am using the latest (2.something) version. I'm new to CodeIgniter and I was roaming with it, but I can not even add a simple CSS file: ( 

My view is in /logic/views/index.php , my CSS files / css /

.

I think your problem is that base_url is a function in ci 2+, so try it instead

   link href =" & lt; ? Php echo base_url ()? & Gt; css / style.css "rel =" stylesheet "type =" text / css "/>   

How do you define base_url If you had otherwise slashed the finish, just add a slash then

  /css/style.css    < / Html>

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -