Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 691 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 691 Bytes

PdfSafe Twig extension

Packagist

Clean a HTML/XML input to be generated in PDF by psliwa/php-pdf library.

Install

composer require rezozero/pdfsafe

Add this extension in your Twig environment.

use RZ\PdfSafe\PdfSafeExtension;
use Symfony\Component\HttpFoundation\Request;

$container->extend('twig.extensions', function ($extensions, $c) {
    /** @var Request $request */
    $request = $c['request'];
    $extensions->add(new PdfSafeExtension($request->getSchemeAndHttpHost()));
    return $extensions;
});