In PHP templates I can use php functions, for example:
foreach ($users as $user){
echo someFunction($user->getName());
}
How can I make it in TWIG?
{% for user in users %}
* {{ user.name }}
{% else %}
No user have been found.
{% endfor %}
How do I achieve this?
What you need are functions or filters. You can easily add these using the examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With