In my preprocessor I assign the following:
$variables['myVar'] = "value";
And in my twig file I can do the following and I get the value printed:
{{ myVar }}
If I however assign an array like this in my preprocessor:
$variables['myVar'] = ['name' => 'John','surname' => 'Doe'];
I am not able to get any output either through the outputting the variable, doing a dump or even trying to run it through a for loop:
{{ dump('myVar') }}
{% for items in myVar %}
I have cleared cache as well. Any ideas would be welcome :)