I want to do a simple str_replace in my twig template. I'm new to twig and probably I need to add new filter or sth like that or to use existing. How can I do this? Where can I find list of filters available?
Use this to replace |
with -
and replace ,
width .
:
{{age|replace({'|': "-", "," : "."})}}
Example input 31|60,
comes out as 31-60.
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