Welcome Guest, Not a member yet? Register   Sign In
Dynamic CSS file that is populated by the database?
#1

[eluser]Starman[/eluser]
Hi,
I'm hoping someone here may be able to help with a problem that I have. I know how populate a php file with css and then link it to the html pages that are to be styled without using codeigniter. But is it possible to use codeigniter and still accomplish the same thing?

Thanks for reading Smile
#2

[eluser]DimCI[/eluser]
You can link an external css file, or use page style residing in HEAD section, or use inline styling... ANYthing you can do with CSS without CI, you can do using CI... because CI does not care if you use css or not Wink
#3

[eluser]Starman[/eluser]
Thanks for the help dude,
however I am aware of all the methods you mentioned & Use them regularly. I think you may have misunderstood what I am trying to achieve, which is my fault becase I'm bad at explaining things. What I am trying to do is create a dynamic stylesheet, like the example at: http://www.barelyfitz.com/projects/csscolor

Can somebody please tell me a way that I can achieve this?
#4

[eluser]DimCI[/eluser]
If you understand how to do this in a usual way (= as you did before you fall in love with CI Wink ), but now you have some problems, this may be means you have not realize how to make applications using CI (MVC approach) imho... CI does not put any limitations of this kind i guess. Create a simple application using some guide, there are a few around. Step by step. But if you CAN create a MVC application using CI framework but still have problems with the issue you describe, I do not know how to help.
#5

[eluser]danmontgomery[/eluser]
The link you posted has step by step directions to accomplish exactly what you're describing, what's the problem?
#6

[eluser]Starman[/eluser]
My problem is this;
styles.php is located outside of the CI system folder, like this:

public_html
-system
-images
-css
--styles.php


In my user controller, I run a method from my user model to get the users row from the db & return the row as an object, like this:

$this->data['user'] = $this->User_model->getUserById($userid);

From here, how can I put the contents of $this->data['user']->css_content into styles.php ?


Thanks in advance.
#7

[eluser]trumpetnl[/eluser]
- create a css file at that point with the name
- format that data (your basicly writing a 'report')
- write it to the css file
- close the file

but im guessing this is your general idea :-)

check the file and directory permissions. CI puts items in different places due to the MVC pattern, but does nothing with file access right on your server.




Theme © iAndrew 2016 - Forum software by © MyBB