|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
klaing ny Smarty n00b
Joined: 03 Dec 2010 Posts: 1
|
Posted: Tue Jan 18, 2011 7:23 am Post subject: How to Integrate Jquery in smarty |
|
|
Hi, I'm new with smarty. I want to integrate Jquery with smarty. Does anyone has sample or tutorials to integrate Jqury with smarty.
Thanks |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Tue Jan 18, 2011 8:48 am Post subject: |
|
|
What exactly do you mean by integrate? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jan 18, 2011 3:02 pm Post subject: |
|
|
Just put jQuery in templates just like you would use it with plain HTML. Be careful using { and } tags in javascript so Smarty doesn't try to parse them as Smarty tags. Smarty 3 will ignore them if they are surrounded by white space. Otherwise use {literal}{/literal} tags around stuff you want Smarty to ignore.
Also be careful of filepaths in javascript. They are going to be relative to the URL path, not the template file or php file path. |
|
Back to top |
|
Gibouille Smarty n00b
Joined: 28 Mar 2011 Posts: 1
|
Posted: Tue Apr 12, 2011 8:04 am Post subject: |
|
|
I want to be able to use jquery in SMARTY and have my php constants available in the jquery context through {$smarty.const}
should my javascript be in .js or .tpl files ?
what's the deal with
<script type="text/javascript">
//<![CDATA[
//]]>
</script>
and
{literal}{/literal} |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|