|
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 |
durangod Smarty Regular
Joined: 10 Feb 2011 Posts: 39
|
Posted: Sat Mar 12, 2016 6:39 am Post subject: What is the -{ for |
|
|
Hi,
I normally work on older versions of smarty but today i ran across something i had not seen before.
While working on a tpl file i found an if statment that was wrapped with the - sign.
Example: -{if whatever == 1}-
do something
-{/if}-
upon investigation i discovered that the - sign was preventing the code from being parsed to the page upon execution. With the - it was not present on page and ran just fine.
I have never seen this before, is this something new to smarty? Is this a custom engine based on smarty?
Anyone ever seen this and can explain this to me, thanks...
|
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
Posted: Sat Mar 12, 2016 9:42 am Post subject: |
|
|
No, it's available for a long time .
You can define the delimiters like you want. Default is {...}.
But the brackets are used too by JavaScript, CSS and so on.
So you can define other delimiters and Smarty will running without any problems. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Mar 12, 2016 7:08 pm Post subject: |
|
|
Custom delimiters were a Smarty feature for a long time. Longer than I can remember.
This may be useful, if you need to process template through two engines (i.e. a secure and insecure templating instances, or a template engine that itself generate templates for later execution by an actual webserver). |
|
Back to top |
|
durangod Smarty Regular
Joined: 10 Feb 2011 Posts: 39
|
Posted: Wed Mar 16, 2016 10:58 am Post subject: |
|
|
Hi thank you both, yes i have seen and used the {} myself in coding just never saw a custom delimeter like that lol..
Sorry for the late "thank you" i have been sick for a few days.
Appreciate the info i will use that more often |
|
Back to top |
|
elpmis Smarty Elite
Joined: 07 Jun 2007 Posts: 321
|
|
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
|