smarty
Formatting numbers with thousands separator Smarty PHP
or you can use php function inside smarty, this is for number_format, you can use other php function too 🙂 PHP : number_format($number, 2, ‘.’, ‘,’); SMARTY : {$number|number_format:2:”.”:”,”}
How can I get current URL using smarty
You can use this, too. {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}
How do you increment an assigned variable in smarty without displaying it
You could do this: {assign var=val value=1} {assign var=val value=$val+1} {$val} // displays 2 The above will be compiled to: $this->assign(‘val’, 1); $this->assign(‘val’, $this->_tpl_vars[‘val’]+1); echo $this->_tpl_vars[‘val’]; or {assign var=var value=1} {capture assign=var}{$var+1}{/capture} {$var} // displays 2 Which in turn will be compiled as: $this->assign(‘var’, 1); ob_start(); echo $this->_tpl_vars[‘var’]+1; $this->_smarty_vars[‘capture’][‘default’] = ob_get_contents(); $this->assign(‘var’, ob_get_contents()); ob_end_clean(); echo … Read more
Why should I use templating system in PHP? [closed]
Yes, as you said, if you don’t force yourself to use a templating engine inside PHP ( the templating engine ) it becomes easy to slip and stop separating concerns. However, the same people who have problems separating concerns end up generating HTML and feeding it to smarty, or executing PHP code in Smarty, so … Read more
What are .tpl files? PHP, web design
That looks like Smarty to me. Smarty is a template parser written in PHP. You can read up on how to use Smarty in the documentation. If you can’t get access to the CMS’s source: To view the templates in your browser, just look at what variables Smarty is using and create a PHP file … Read more