|
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 |
Don't you agree? |
No, you're superising. that's what i need. |
|
0% |
[ 0 ] |
Yes, i don't like it... |
|
100% |
[ 1 ] |
|
Total Votes : 1 |
|
Author |
Message |
yarco Smarty Regular
Joined: 20 Mar 2009 Posts: 39
|
Posted: Tue Jul 07, 2009 8:38 am Post subject: feture request: condition(or some other keyword) compile |
|
|
Though i could do it use if/else keywords, what i've said here is not the logical of views.
For example:
I would like to add google analyze script in my product version page, but don't want it in develope version. So i could use such keyword to exclude that.
{condition value="production"}
...google scripts...
{/condition}
I could also turn on it:
$smarty->set_condition('production');
or settings in configure file:
condition=production
don't you agree? |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Tue Jul 07, 2009 10:16 am Post subject: |
|
|
I don't get how it's different than an if.
unless you are talking about some type of macro thing like C, in which the code is just not included at all.
either way, i'm not convinced it's needed.
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jul 08, 2009 2:44 am Post subject: |
|
|
Code: | $smarty->assign('production',true); |
Code: | {if $production}...{/if} |
|
|
Back to top |
|
yarco Smarty Regular
Joined: 20 Mar 2009 Posts: 39
|
Posted: Wed Jul 08, 2009 3:30 am Post subject: |
|
|
1. That is just like switch/case vs if/else.
Although we could use if/else instead of switch/case, we still have switch/case keywords(in php).
2. The smarty kernel support
Quote: | or settings in configure file:
condition=production |
If we do:
Quote: |
$smarty->assign('production',true);
{if $production}...{/if}
|
Then the two logicals are mixed together. And we need to concern about the variable itself. |
|
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
|