PHP code example of rezozero / pdfsafe

1. Go to this page and download the library: Download rezozero/pdfsafe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rezozero / pdfsafe example snippets


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;
});