Welcome Guest, Not a member yet? Register   Sign In
Pass variable from Controller to dynamic CSS file?
#2

[eluser]fuchong[/eluser]
I'm not sure about how CI sessions and non-CI sessions work but what about the following?

Since the PHP files that you're calling are outside of the CI structure, they can accept query strings. Why not append a query string at the end and just use $_GET to grab what you want.

For example inside you're CI view

Code:
<link type="text/css" media="screen" rel="alternate stylesheet" title="Color Scheme #1" href="css-demo.php?scheme=alt1" />

And inside your dynamic CSS file
Code:
$scheme = $_GET['scheme'];

if($scheme == 'alt1'){
    // do some CSS relating to alt1
}

else{
    // do some other CSS
}


Messages In This Thread
Pass variable from Controller to dynamic CSS file? - by El Forum - 03-15-2012, 01:16 PM
Pass variable from Controller to dynamic CSS file? - by El Forum - 03-17-2012, 12:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB