Welcome Guest, Not a member yet? Register   Sign In
Where to put Smarty, Styles, Scripts, etc?

I need some advice on where to put the following directories:

- styles (for all my CSS stuff)
- scripts (for all my JS stuff)
- images (for all my image resources)
- Smarty library

I think styles, scripts, and images should be at the same level as my CI /system/ folder. So:


Is the above a good idea?

I'm not sure about where to put Smarty library, cache folder, etc.

Any assistance is appreciated. Thanks.

[eluser]Johan André[/eluser]
I used smarty once (a long time ago) and I put it in application/libraries.

I use an assets folders at the same level as my CI/system folder.


About Smarty, on a linux server I install Smary using "$ sudo aptitude smarty" and later I create my own library for use Smarty in CodeIgniter.

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');


class CI_Smarty extends Smarty {

function CI_Smarty()

//Your code here

This is a good approach for use in a server enviroment. Smarty classes will be shared with other web apps.


[eluser]Jamie Rumbelow[/eluser]
Hey CodeIgniterNewbie,

I generally have a index.php-level assets/ folder, which holds subfolders for all my static assets. As far as Smarty goes, the two aforementioned techniques work fine. It's up to what you feel comfortable with.


Theme © iAndrew 2016 - Forum software by © MyBB