So i have this array in my indexController
$numbers = [
'prime' => [2, 3, 5, 7, 11],
'fibonacci' => [1, 1, 2, 3, 5],
'triangular' => [1, 3, 6, 10, 15]
];
And i tried outputing it in the render function like this
'primes' => $numbers['prime']
and like this
$primes = $numbers['prime'];
'primes' => $primes
and in my index.html.twig i just have this simple call
{{ primes }}
Exception
An exception has been thrown during the rendering of a template ("Notice: Array to string conversion").
{%for%}to show the array elements. if you have many arrays you can write a filter for their representing .