so I have some php variables, some are form an array. I can print them like this
echo $arr->title;
echo $arr->date;
echo $xml;
echo $cover;
I am using twig. I think I need to combine specific php variables into one array(say book) so I can render my twig template with
echo $template->render(['book' => $book]);
then in my twig template be able to use
{{ title }}
{{ date }}
{{ xml }}
{{ cover }}
any tips on how to achieve this would be greatly appreciated .