PHP code example of designcise / manifest-json

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

    

designcise / manifest-json example snippets


use Designcise\ManifestJson\ManifestJson;

$manifest = new ManifestJson('path/to/manifest/'); // defaults to `manifest.json`
// or $manifest = new ManifestJson('path/to/manifest/my-manifest.json');

$entry = $manifest->get('entry.js');
$metadata = $manifest->getAll();
$css = $manifest->getAllByType('css');
$images = $manifest->getAllByTypes(['jpg', 'png']);
$js = $manifest->getAllByKey('*.js');
$criticalJs = $manifest->getAllByKeyBasename('critical-*.js');

ManifestJson::from('path/to/manifest/'); // defaults to `manifest.json`
ManifestJson::from('path/to/manifest/my-manifest.json');