I'am writing a plugin that has to return an array of data, however Twig does not seem to accept it if I return a PHP array. I don't want to use an explode in Twig to make it into an array.
I have seen in other plugins i can just call a function from twig like this.
{% set result = craft.winkelwagen.printWinkelWagen(currentUser.id) %}
{% for output in result %}
{{ output }}
{% endfor %}
However, I get an array to string conversion error. Does anyone know the correct way to do this?
Thanks in advance.