[eluser]vile[/eluser]
[quote author="CI Coder" date="1259123157"]First of all I think you have "/css/default.php" outside of CI's directory structure. If that's the case you cannot do what you want. What you want to do is done by making the stylesheet a CI view and passing all the data to it as normal. So, if you want to try it here it is:
Make a view: stylesheet.php that contains this: (just like a css file)
Code:
body
{
background-color: <?php echo $bgcolor;?>;
}
in the view of your page
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Theme</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>theme">
</head>
<body>
TEsting
</body>
</html>
then in your Theme::index() function do this:
Code:
function index()
{
$data['bgcolor'] = "#ff0000";
$styles = $this->load->view('stylesheet',$data, TRUE);
header('Content-type: text/css');
echo $styles;
}
It's a good idea to do it this way. It'll give you a lot of options later in the design.
Good luck.[/quote]
Thanks! it worked.
i used <style></style> instead of header().