|
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 |
shinn Smarty n00b
Joined: 07 May 2014 Posts: 2
|
Posted: Wed May 07, 2014 1:48 am Post subject: strip between beta and production site |
|
|
i want to do {strip} on production site only, but the code seems fail.
<{if $deploy == 'PUBLIC'}>
<{strip}>
<{/if}>
some html code
<{if $deploy == 'PUBLIC'}>
<{/strip}>
<{/if}>
it will do strip when $deploy = 'beta' |
|
Back to top |
|
bluejester Smarty Regular
Joined: 26 Apr 2012 Posts: 55
|
Posted: Wed May 07, 2014 12:21 pm Post subject: |
|
|
You'd better do this on PHP side.
Remove your {strip} in your TPL.
In your PHP, add something like this :
Code: |
if ($deploy == 'PUBLIC')
$smarty->loadFilter('output', 'trimwhitespace');
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu May 08, 2014 4:06 am Post subject: |
|
|
{strip} is no runtime tag and stripping is done when the template gets compiled.
Using the output filter is the better choice. |
|
Back to top |
|
shinn Smarty n00b
Joined: 07 May 2014 Posts: 2
|
Posted: Thu May 08, 2014 6:44 am Post subject: |
|
|
thanks, it's working. |
|
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
|