PHP code example of siteparts / plates-asset

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

    

siteparts / plates-asset example snippets


use SiteParts\Templating\Plates\Extension\Asset\AssetExtension;

// $engine is instance of League\Plates\Engine
// $assetHelper is instance of SiteParts\Asset\AssetHelper
$engine->loadExtension(new AssetExtension($assetHelper));
html+php
<img src="<?= $this->assetUrl("img/image.png")