|
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 |
JayEn84 Smarty n00b
Joined: 27 May 2015 Posts: 3
|
Posted: Tue Aug 01, 2017 9:32 am Post subject: Assigning boolean using short hand of {assign} makes strings |
|
|
I want to assign the boolean value true or false to a variable using {assign} within a Smarty template.
Using the conventional way does what I want. But using the short hand version of {assign} creates the strings "true" and "false" instead of the boolean values true and false.
See this sample script:
Code: | <pre>
{* conventional way: creates a boolean value, correct *}
{assign var="testVar" value=true}
{$testVar|var_export:true}
{* short hand way: creates a string value, bug! *}
{assign "testVar" true}
{$testVar|var_export:true}
</pre> |
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Aug 01, 2017 5:31 pm Post subject: |
|
|
|
|
Back to top |
|
JayEn84 Smarty n00b
Joined: 27 May 2015 Posts: 3
|
Posted: Mon Aug 07, 2017 4:40 pm Post subject: |
|
|
Thanks, this is much better!
However, what I have posted is still a bug, right? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Aug 07, 2017 10:31 pm Post subject: |
|
|
If you feel it that way, please post an issue on GitHub. |
|
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
|