Welcome Guest, Not a member yet? Register   Sign In
how to load two files
#1

[eluser]Mr.President[/eluser]
I have a css file I am generating it using php(codignitor)
then the view file will use the css to style
now the problem is how am I going to load css and go to the view file
I mean I have to load two files @ once

ie.
The css file
Code:
retrieve from db an generate generate css


The view file
Code:
<html>
    <css=gen.css.php>
...
...
usage of css selectors and sent $data from control
&lt;/html&gt;
#2

[eluser]JoostV[/eluser]
You do not have to load the css file. Create a controller that fetches the css code from db and echoes it to te browser. Then call that controller from the view, just like you would call a normal css file
Code:
&lt;link rel="stylesheet" href="&lt;?php echo base_url(); ?&gt;/css_controller/css_method/&lt;?php echo $css_d; ?&gt;" type="text/css" media="screen" /&gt;

For best results you want to set the header for the output from your css controller:
Code:
header('Content-type: text/css');
#3

[eluser]Mr.President[/eluser]
thankx that solved the problem




Theme © iAndrew 2016 - Forum software by © MyBB