Welcome Guest, Not a member yet? Register   Sign In
dynamic CSS generation with CI
#1

[eluser]Unknown[/eluser]
Hi,

I'm trying to "dynamically" generate CSS files with CI. I have created a controller and a view that return the CSS with some dynamic stuff (like links to images that change depending on the location of the page on the server). I am able to fetch it and it works OK except that firefox recognizes the meta type as text/html (instead of text/css) and won't load the css due to security reasons..

I either need a way for some view (e.g. http://localhost/some/function/css) to return the CSS as text/css meta type or somehow manage images to load from the root of without the first / in the link (e.g. <img />) because it breaks if the site is not in the root of the domain..
#2

[eluser]Tominator[/eluser]
Code:
$this->output->set_header('Content-type: text/css');




Theme © iAndrew 2016 - Forum software by © MyBB