CodeIgniter Forums
Where to put Smarty, Styles, Scripts, etc? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Where to put Smarty, Styles, Scripts, etc? (/thread-27316.html)



Where to put Smarty, Styles, Scripts, etc? - El Forum - 02-07-2010

[eluser]CodeIgniterNewbie[/eluser]
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:

/images/
/scripts/
/styles/
/system/
/system/application/
/system/cache/
...

Is the above a good idea?

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

Any assistance is appreciated. Thanks.


Where to put Smarty, Styles, Scripts, etc? - El Forum - 02-07-2010

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


Where to put Smarty, Styles, Scripts, etc? - El Forum - 02-20-2010

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

/assets
--->js
--->css
--->img

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');


require_once('/usr/share/php/smarty/Smarty.class.php');

class CI_Smarty extends Smarty {

function CI_Smarty()
{
parent::Smarty();
}

//Your code here
}

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

JonyR


Where to put Smarty, Styles, Scripts, etc? - El Forum - 02-20-2010

[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.

Jamie