PHP code example of wijourdil / statically-cdn-helper

1. Go to this page and download the library: Download wijourdil/statically-cdn-helper 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/ */

    

wijourdil / statically-cdn-helper example snippets


$app->register(\Wijourdil\Statically\StaticallyCdnHelperServiceProvider::class);

// Before
asset('img/photo.png')
// => 'https://site.com/img/photo.png'

// After, without mix-manifest.json 
cdn('img/photo.png')
// => '//cdn.statically.io/img/site.com/img/photo.png'

// After, with mix-manifest.json 
cdn('img/photo.png')
// => '//cdn.statically.io/img/site.com/img/photo.png?id=23ea1efe0290977b58d454f5164b2a32'