We create another Twig function but this time we pass in an array of words to use as replacements.
In this example, we’re going to manipulate text passed into the function using values passed into the function and then output.
Here’s how we’ll use it in our Twig template:
{{ plantify(['soy', 'beans', 'tofu', 'seitan', 'mushrooms', 'Beyond Burger', 'Tofurkey'], text) }}

I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.