Capitalize in Smarty
Capitalize is one of the Variable modifiers. Variable modifiers can be applied to variables, custom functions or strings. To apply a modifier, specify the value followed by the | (pipe) and the modifier name. A modifier may accept additional parameters that affect its behavior. These parameters follow the modifer name and are separated by : (colon).
Example:
<?php
$smarty->assign(’input’,'this is sample string’);
?>
Where template is:
{$input}
{$input|capitalize}
{$input|capitalize:true}
This will output:
this is sample string
This is sample string
This Is Sample String
