[eluser]AlexDSX[/eluser]
Hi everyone, I've set up my config file to contain all my main CSS stylesheets and this works well, however each controller now needs to set an additional stylesheet. Here's what I have so far:
config.php (config file):
Code:
//CSS list
$config['template']['css'] = array(
"main" => "main",
"grid" => "grid",
"elements" => "elements",
"features" => "features",
);
main.php (view)
Code:
<?php foreach ($template['css'] as $stylesheet): ?>
<link href='/css/<?php echo $stylesheet; ?>.css' rel='stylesheet' type='text/css' />
<?php endforeach; ?>
I have a template library which sets the view for a page, I would build on this library to create a new function that will take my arguments and add it to my CSS array.
Desired solution:
Code:
$this->template->css('index', 'root/css/index');
Thanks for having a look and please help me out.