Welcome Guest, Not a member yet? Register   Sign In
Best Practices Question: Where to put module-specific and application-specific css and js
#1

[eluser]Unknown[/eluser]
Actually, two questions, but they're related.

Where's the best place to put application-specific and module-specific css and js, and what's the "proper" way to reference them.

At the moment, I have a css directory under /views, which seems reasonable, since the stylesheet is directly related to the template (and I'm a firm believer in not embedding css in HTML). If that's the right spot to keep them, how should I access it? Right now, I'm pointing to /application/views/css/style.css, but I doubt that's right. Or if it is right, it should probably be prefixed with something (like an APP_DIR constant?)

Similar question about javascript, although there it's even more likely that I'll have js that is specific to a view or module (and again, no js script tags in html!). I can get my code to work, but I was wondering if someone could point me to the recommended way to doing this.

Thx,

Tac
#2

[eluser]InsiteFX[/eluser]
Create an asset directory in the root with index.php

asset
-- css
-- js
-- img
-- media
-- ico

There are a few asset libaries around in the forums.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB