|
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 |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Feb 03, 2005 4:09 pm Post subject: My javascript/CSS curly braces are creating errors |
|
|
Curly braces {} are the default delimiters in Smarty. If you don't want curly braces interpreted as Smarty tags, you must enclose them in {literal}{/literal} tags. Example:
Code: | {literal}
<script language="javascript">
<!--
function getPrompt() {
// js function here
}
//-->
</script>
{/literal} |
You can also use {ldelim}{rdelim} tags in place of the curly braces themselves. This is useful if you need working Smarty tags within the escaped braces. Example:
Code: | <script language="javascript">
<!--
function getPrompt() {ldelim}
// js function here
{rdelim}
//-->
</script> |
Note: Smarty 3 no longer requires literal tags as long as the braces are surrounded by white space.
See the documentation for more information:
http://www.smarty.net/docs/en/language.function.literal.tpl
http://www.smarty.net/docs/en/language.function.ldelim.tpl
http://www.smarty.net/docs/en/language.modifier.escape.tpl |
|
Back to top |
|
|
|
You can post new topics in this forum You can 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
|