Answers for "replace twig strng"

PHP
1

string replace twig

{{description|replace({"\'": "'"})|raw }}
Posted by: Guest on May-11-2020
0

replace twig

{{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}

{# outputs I like foo and bar
   if the foo parameter equals to the foo string. #}

{# using % as a delimiter is purely conventional and optional #}

{{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }}

{# outputs I like foo and bar #}
Posted by: Guest on January-14-2022

Browse Popular Code Answers by Language