I am trying to step a bit beyond the basic usage of Smarty and ran into a small problem using the default "capitalize" modifier. I am operating with the assumption that no explicit calls need to be made to use this operator so in my template I have the following:
{* Smarty Part: Add-ins *}
<div class="control-group form-inline">
<label class="control-label">Add-ins:</label>
<div class="controls ">
{foreach $add_ins as $add_in}
<label class="checkbox inline"><input type="checkbox" cf-change="toggle-field::#{$add_in}-add-in"> {$add_in|capitalize}</label>
{/foreach}
</div>
</div>
If I were to replace the:
{$add_in|capitalize}
with
{$add_in}
It would work fine but adding the modifier gives me the following error:
PHP Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template [FILE_PATH] on line 7 "<label class="checkbox inline"><input type="checkbox" cf-change="toggle-field::#{$add_in}-add-in"> {$add_in|capitalize}</label>" unknown modifier "capitalize"'
Any help would be greatly appreciated.