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

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Where to put Smarty, Styles, Scripts, etc? (/showthread.php?tid=27316)



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