render('invoice.html.twig', [ 'configuration' => $config['configuration'], 'trans_data' => [ 'source' => $source, //'target' => $target, ], 'services' => $services, 'images' => $images, ]); } private static function getImagesContent(array $paths): array { $new = []; foreach ($paths as $key => $path) { $new[$key] = file_get_contents(Kernel::getProjectRoot().'/'.$path); } return $new; } private static function createTwig(): Twig { $loader = new FilesystemLoader(__DIR__.'/../../templates'); $twig = new Twig($loader); $twig->addExtension(new NumberToWordsExtension()); $twig->addExtension(new HtmlExtension()); return $twig; } }