Formatting money in twig templates

The number_format filter has been included in the Twig core since the end of December 2011. The relevant commit is here. Usage: number_format(decimals, decimalSeparator, thousandSeparator) {{ total|number_format(2) }} {{ total|number_format(0, ‘.’) }} {{ total|number_format(2, ‘.’, ‘,’) }} Read more about it in the docs

How to render a tree in Twig

I played around with domi27’s idea and came up with this. I made a nested array as my tree, [‘link’][‘sublinks’] is null or another array of more of the same. Templates The sub-template file to recurse with: <!–includes/menu-links.html–> {% for link in links %} <li> <a href=”https://stackoverflow.com/questions/8326482/{{ link.href }}”>{{ link.name }}</a> {% if link.sublinks %} … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)