Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

{literal}

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
metalkid
Smarty Rookie


Joined: 28 Mar 2009
Posts: 5

PostPosted: Sat Mar 28, 2009 3:08 am    Post subject: {literal} Reply with quote

In smarty3 can we look into dropping this for javascript blocks? Wouldn't it make sense to automatically literal out anything between <script> tags?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7366
Location: Lincoln Nebraska, USA

PostPosted: Sat Mar 28, 2009 3:20 am    Post subject: Reply with quote

smarty 3 already ignores braces that are surrounded by non word characters, so something like:

Code:
function foo {
   ....
}


will not need literal tags. this pretty much covers it for javascript and css, unless it somehow resembles smarty tags like {foo ...} or {$foo}


Last edited by mohrt on Sat Mar 28, 2009 3:36 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
metalkid
Smarty Rookie


Joined: 28 Mar 2009
Posts: 5

PostPosted: Sat Mar 28, 2009 3:35 am    Post subject: Reply with quote

ah very nice... drove me nuts, especially when i used smarty vars in the js, had literal tags everywhere Smile
Back to top
View user's profile Send private message
yarco
Smarty Regular


Joined: 20 Mar 2009
Posts: 39

PostPosted: Mon Mar 30, 2009 3:10 am    Post subject: Reply with quote

great!

So does that mean i don't need to redifine smarty delimiters to "{{" and "}}"?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7366
Location: Lincoln Nebraska, USA

PostPosted: Mon Mar 30, 2009 3:14 am    Post subject: Reply with quote

yarco wrote:
great!

So does that mean i don't need to redifine smarty delimiters to "{{" and "}}"?


Probably not.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP