PHP code example of siteparts / asset
1. Go to this page and download the library: Download siteparts/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 / asset example snippets
use SiteParts\Asset\AssetHelper;
$localPath = "public";
$basePath = "/app";
$assetHelper = new AssetHelper(
$localPath,
$basePath
);
$styleUrl = $assetHelper("css/style.css");
// $styleUrl contains e.g. "/app/css/style.css?v=1591103864"
$imageUrl = $assetHelper("img/image.png");
// $imageUrl contains e.g. "/app/img/image.png?v=1591057923"