Welcome Guest, Not a member yet? Register   Sign In
Problems with css links

[eluser]Julius Romo[/eluser]
Hi !

This is my first post in a new world called Codeigniter (at least, new for me).

My files structure is as this:



My problem is calling css files...

Where would be the logical place to place them? Dub-dir in views? Sub-dir in fw?

And how may I call them? I have tried with some posts here, but I couldn't get it.

Thank you very much.

Greetings, and welcome to the CI forums.

I think the most popular place is in a sub-directory at a peer to system. Often people create a directory at that level called assets and that's where their javascript, stylesheets, etc live. (In their own sub-directories too, is neater).

You have a .htaccess at that level that protects your assets directory from being mis-interpreted, eg:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /devel/pdb3/index.php/$1 [L]

In my case, of course, my project lives at ... devel/pdb3

And within your views you can call the stylesheet thus:

jedd is totally right, and it's also a good practice to keep the system dir outside the doc root, if you have permissions to do it.


[eluser]Julius Romo[/eluser]
Thank you very much.

I am looking if I can take out system dir.... In local, I can (of course), but I'll see if I can do in my hosting.

By the way, just tell that I'm working in a medieval game (from 1 to "infinite" players), as MTW2 (with no strategical battles). When the game reach 0.1 version, i'll show....

I think CI will make easier my work.

Quote:By the way, just tell that I'm working in a medieval game ...

Excellent - it's much easier to have an actual project like this to work on when you're learning this stuff. We look forward to seeing the 0.1 pre-alpha release!

Theme © iAndrew 2016 - Forum software by © MyBB