![]() |
Paths with Smarty templates - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Paths with Smarty templates (/showthread.php?tid=48647) |
Paths with Smarty templates - El Forum - 01-23-2012 [eluser]Ed Robindon[/eluser] Hi All, New to CI but I have implemented XAJAX and Smarty in the framework. They really work nice inside of CI controllers and views. Using Smarty one just puts link and script tags in the header tags of the template files. The problem I am having is where do I put my js and css files so that CI will find them. Right now using a WAMP server and put these files in folders underneath wamp/www/. It works but is not too esthetically pleasing. Any thoughts? Thanks, Ed Paths with Smarty templates - El Forum - 01-23-2012 [eluser]Aken[/eluser] You'd put them in whatever public web folder is appropriate. For instance, if mamp/www is the main folder that http://localhost points to, then you can put them anywhere inside of there. If your application is in a subfolder of the web root, put them in the subfolder. If you can install and use CodeIgniter, you should be able to figure out a folder structure for your assets ![]() Paths with Smarty templates - El Forum - 01-23-2012 [eluser]Ed Robindon[/eluser] So I created wamp/www/assets and put js,images,css and other libs in it. This works and I'll go with it for a time. It would work on the hosted site. My layout is wamp/www/codeigniter ... If I put the assets folder in the codeigniter folder , they are not recognized. Paths with Smarty templates - El Forum - 01-24-2012 [eluser]Aken[/eluser] It's probably just an issue with relative URLs - looking for your assets in the wrong place. Here is a typical base structure I use for CI apps: Code: root/ Paths with Smarty templates - El Forum - 01-24-2012 [eluser]Ed Robindon[/eluser] Thanks Aken. I'll play with it some more. Paths with Smarty templates - El Forum - 01-24-2012 [eluser]Ed Robindon[/eluser] Well, turns out it was my htaccess coding. Initially used the file included with CI. Now use: Code: <IfModule mod_rewrite.c> and life is good again. Thanks for your help. Paths with Smarty templates - El Forum - 01-24-2012 [eluser]Aken[/eluser] Cheers! |