CodeIgniter Forums
How to use YUI or JQuery in Smarty template on Igniter Framework - 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: How to use YUI or JQuery in Smarty template on Igniter Framework (/showthread.php?tid=3412)



How to use YUI or JQuery in Smarty template on Igniter Framework - El Forum - 09-29-2007

[eluser]Blue Sapphire[/eluser]
Hi!

Can anyone give idea with working example that how YUI or jquery is used in smarty template on Igniter framework?

Thanks in advance


How to use YUI or JQuery in Smarty template on Igniter Framework - El Forum - 09-29-2007

[eluser]nmweb[/eluser]
Code Igniter isn't really relevant here. Just make sure you include the proper .js files (those of jQuery and YUI) in the template your using in the relevant section, i.e. the <head> section of your HTML document.

Code:
<html>
<head>
script src="http://www.hichte.nl/gz.php?uri=jquery.min.js" type="text/javascript"
</head>
&lt;body ... </html&gt;
Make sure the path to the jquery file is right, follow the examples on jquery.com and make sure your template has something like this in it, wouldn't be of much use if it didn't Smile

Most difficult part seems to be integrating Code Igniter with Smarty but as I understand your post you already got that.

This seems to be a good tutorial on how to combine jQuery and CI


How to use YUI or JQuery in Smarty template on Igniter Framework - El Forum - 09-29-2007

[eluser]esra[/eluser]
You might want to take a look at how this is handled in Jack Slocum's EXT JS layout examples on the EXT JS site. EXT JS started off as a set of extensions for YUI, but has since become a standalone library. The EXT JS layouts have undergone changes since the framework was made a standalone library but the basic principles for incorporating the EXT or YUI libraries in a template are similar. Take a look at the Complex layout example in that library.

http://extjs.com/

The basic principle to adding the libraries should remain the same for Smarty or any other view renderer you plan to use. For a specific example of using EXT JS with CI, find Coolfactor's thread on his proposed View library for CI.