PHP code example of endroid / asset

1. Go to this page and download the library: Download endroid/asset 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/ */

    

endroid / asset example snippets


$dataAsset = $assetFactory->create([
   'controller' => CoverController::class,
   'parameters' => ['title' => 'My PDF', 'date' => new DateTime()],
   'cache_key' => 'cover',
   'cache_expires_after' => 3600,
   'cache_clear' => true, // use to purge any previously cached data
]);