Welcome Guest, Not a member yet? Register   Sign In
Acessing & modifying config items from library
#1

[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. Smile


Messages In This Thread
Acessing & modifying config items from library - by El Forum - 04-24-2012, 01:01 PM
Acessing & modifying config items from library - by El Forum - 04-24-2012, 02:16 PM
Acessing & modifying config items from library - by El Forum - 04-24-2012, 02:18 PM
Acessing & modifying config items from library - by El Forum - 04-24-2012, 02:19 PM
Acessing & modifying config items from library - by El Forum - 04-24-2012, 03:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB