[eluser]coolfactor[/eluser]
Not directly, but if you are willing to spare the processing cycles, you could treat CSS and JS files as views.
Say you have an "Assets" controller that has css() and js() functions:
Code:
<link type="text/css" href="/assets/css/styles.css" />
The css() function could:
1) get the full uri: /assets/css/styles.css
2) strip off first 2 segments to be left with: styles.css
3) look for a view file called that.
Code:
function css() {
// strip off first 2 segments from uri
$css_file = str_replace('/assets/css/', '', $this->uri->uri_string());
// assign any variables to the view
$data['ajax_base_url'] = '/something/here/';
$data['bg_img_url'] = '/something/else/here/';
// send appropriate headers
$this->output->header('Content-Type: text/css');
// load the processed css file
$this->load->view($css_file, $data);
}
(example code only)
You could do the same for JavaScript files. Just make sure to pass along the correct headers that the browser is expecting for those files.