I\'m a bit confused here.
I have a simple controller which loads a view. The view contains a form and links some CSS files. I don\'t really want to do ../../cs
You can use the URL helper to ease your URL woes :)
http://codeigniter.com/user_guide/helpers/url_helper.html
Usage
Load it up in your bootstrap
$this->load->helper('url');
And whenever you need something you can use
echo site_url("/css/style.css");
Or just assign it as a handy base url so you can use it wherever you want.
$base_url = site_url('/');
<link href="{$base_url}css/style.css" rel="stylesheet" type="text/css" />
<?php echo 'base url is' . $base_url?>
Note
Remember to define your proper base URL in the config file before using this method.
I think your problem is that base_url is a function in ci 2+ so try this instead
<link href="<?php echo base_url() ?>css/style.css"
rel="stylesheet" type="text/css" />
It depends how you defined base_url if you did an ending slash otherwise just add a slash so
/css/style.css
for CI 2+ you can add $this->load->helper('url'); before you load the view and then add <link href="<?php echo base_url().'css/style.css';?>" rel="stylesheet" type="text/css" /> into your view file.
I put my css files in the root directory and link them like this
<?php echo link_tag('css/forie.css'); ?>
<?php echo link_tag('css/reset.css'); ?>
<?php echo link_tag('css/main.css'); ?>
Using link_tag allows me to access them easily