Skip to content

Instantly share code, notes, and snippets.

@ginsterbusch
Created January 25, 2013 01:43
Show Gist options
  • Save ginsterbusch/4630881 to your computer and use it in GitHub Desktop.
Save ginsterbusch/4630881 to your computer and use it in GitHub Desktop.
smarty template to test whether modifiers are allowed to be used in if-else-clauses or not.
{assign var="strPreis" value='133,00'}
<html>
<head>
<title>formatting test</title>
</head>
<body>
<p>replacement test: {if $strPreis|replace:',':'.' == '133.00'}
works!
{else}
fucks up .. as usual.
{/if}</p>
<p>formatting test: {if $strPreis|string_format:'%1.1s' == '1'}works{else}sucks.{/if}</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment