You probably need to understand how you retrieve data from db and how you display them: codeigniter.com/user_guide/database/inde... good luck.
And then call the fonts you need in your css.
I retrieved data from db in controller. And I want to pass it to view->css. – CappY Feb 17 '11 at 18:39 That way works.
But is it the correct way? By that way I re-include css because every single font? What about overload?
– CappY Feb 17 '11 at 19:04 what I would do is including a string (or an array of links) in my config file and call it in view from there and not calling it again and again and again from database everytime I load the page – rabidmachine9 Feb 17 '11 at 20:14 @Rabidmchine9 - problem I that my data is only in controller... not config. – CappY Feb 17 '11 at 7:50 what do you mean you data is only in controller? – rabidmachine9 Feb 19 '11 at 15:29.
First, deal with serving dynamic CSS. My site has a controller called "resource" which allows me to serve CSS, JS, etc. (maybe images in the future). It loads views based upon the segments passed to it in the url.
So, when mysite.com/resource/css/main.css is requested: My Resource controller (.../controllers/resource) handles any specifics of data handling (as is general with an MVC controller). It then loads: A generic view: ".../views/resources/css. Php", passing it the name of the desired css file.
This view prints out the header, specifying the Content-Type (important! ) and any other generic stuff. Then it proceeds to load: The actual CSS file specified, here ".../views/resources/css/main.css.
Php". It's a little overkill, but allows for a lot of flexibility, like you sound like you need. Controller: ... $segments = $this->uri->segment_array(); array_shift($segments); // remove the first two array_shift($segments); $content'stylesheet' = $segments0 .
". Php"; //e.g.Main.css. Php $content'data' = array(); //Font data, etc $this->load->view('resources/css.
Php', $content); .. Generic resources/css. Php This loads up the actual .css. Php stylesheet /* MySite CSS File (c) 2011 bla bla */ load->view("resources/css/$stylesheet", $data); echo "\n";?
> Specific resources/css/main.css. Php body { background-color: ; } p { font-family: ; }.
In that way do I need to put link in body of my pages...? Or just that. Actually Im using view that loads 3 sub views. 1st view: header,2nd : content, 3rd : footer.
– CappY Feb 17 '11 at 19:47 Yes, you still need to include the CSS file in your HTML, just as if it were a regular, static css file: – Jonathon Reinhart May 3 '11 at 1:18.
Passing variables to a CSS doesn't work for as far as I know. I have read something about CSS templating with PHP, but I can't find the link anymore. Will update this answer as soon as I found the link.
But you could look for it yourself as well. Update Found it! : barelyfitz.com/projects/csscolor.
The easiest way I see you doing this is with file level CSS and changing values the usual way.
A workaround would be to use CSS in the page itself to load the fonts.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.