Loading module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterService.php +9 −1 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterService.php: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ class ExporterService extends PdfExporter { use ContenuServiceAwareTrait; private $vars; private $renderer; public function setRenderer($renderer) { $this->renderer = $renderer; } public function setVars(array $vars) { Loading @@ -23,9 +29,11 @@ class ExporterService extends PdfExporter { public function __construct(PhpRenderer $renderer = null, $format = 'A4', $orientationPaysage = false, $defaultFontSize = 10) { if ($renderer === null) $renderer = $this->renderer; parent::__construct($renderer, $format, $orientationPaysage, $defaultFontSize); $resolver = $renderer->resolver(); $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__]])); // $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); } /** Loading @@ -51,7 +59,7 @@ class ExporterService extends PdfExporter { $titre = $this->getContenuService()->generateTitre($contenu,$this->vars); $this->vars['script'] = $content; $this->addBodyScript('generated.phtml', false, $this->vars); $this->addBodyHtml($content, false, $this->vars); $this->getMpdf()->SetTopMargin(25); $this->getMpdf()->SetTitle($titre); Loading module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterServiceFactory.php +5 −1 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterServiceFactory.php: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenDocument\Service\Exporter; use Interop\Container\ContainerInterface; use UnicaenDocument\Service\Contenu\ContenuService; use Zend\View\Renderer\PhpRenderer; class ExporterServiceFactory { Loading @@ -11,13 +12,16 @@ class ExporterServiceFactory { { /** * @var ContenuService $contenuService * @var $renderer PhpRenderer */ $contenuService = $container->get(ContenuService::class); $renderer = $container->get('ViewRenderer'); /** * @var ExporterService $service */ $service = new ExporterService(); $service = new ExporterService($renderer); // $service->setRenderer($renderer); $service->setContenuService($contenuService); return $service; Loading module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/generated.phtmldeleted 100644 → 0 +0 −9 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/generated.phtml: 0 added lines, 9 removed lines. Original line number Diff line number Diff line <?php /** * @var string $script */ ?> <?php echo $script; ?> No newline at end of file Loading
module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterService.php +9 −1 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterService.php: 9 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ class ExporterService extends PdfExporter { use ContenuServiceAwareTrait; private $vars; private $renderer; public function setRenderer($renderer) { $this->renderer = $renderer; } public function setVars(array $vars) { Loading @@ -23,9 +29,11 @@ class ExporterService extends PdfExporter { public function __construct(PhpRenderer $renderer = null, $format = 'A4', $orientationPaysage = false, $defaultFontSize = 10) { if ($renderer === null) $renderer = $this->renderer; parent::__construct($renderer, $format, $orientationPaysage, $defaultFontSize); $resolver = $renderer->resolver(); $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__]])); // $resolver->attach(new TemplatePathStack(['script_paths' => [__DIR__ . "/partial"]])); } /** Loading @@ -51,7 +59,7 @@ class ExporterService extends PdfExporter { $titre = $this->getContenuService()->generateTitre($contenu,$this->vars); $this->vars['script'] = $content; $this->addBodyScript('generated.phtml', false, $this->vars); $this->addBodyHtml($content, false, $this->vars); $this->getMpdf()->SetTopMargin(25); $this->getMpdf()->SetTitle($titre); Loading
module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterServiceFactory.php +5 −1 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/ExporterServiceFactory.php: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenDocument\Service\Exporter; use Interop\Container\ContainerInterface; use UnicaenDocument\Service\Contenu\ContenuService; use Zend\View\Renderer\PhpRenderer; class ExporterServiceFactory { Loading @@ -11,13 +12,16 @@ class ExporterServiceFactory { { /** * @var ContenuService $contenuService * @var $renderer PhpRenderer */ $contenuService = $container->get(ContenuService::class); $renderer = $container->get('ViewRenderer'); /** * @var ExporterService $service */ $service = new ExporterService(); $service = new ExporterService($renderer); // $service->setRenderer($renderer); $service->setContenuService($contenuService); return $service; Loading
module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/generated.phtmldeleted 100644 → 0 +0 −9 Changes for module/UnicaenDocument/src/UnicaenDocument/Service/Exporter/generated.phtml: 0 added lines, 9 removed lines. Original line number Diff line number Diff line <?php /** * @var string $script */ ?> <?php echo $script; ?> No newline at end of file