PHP code example of dioscouri / f3-minify

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

    

dioscouri / f3-minify example snippets


 // tell Minify where to find Media, CSS and JS files
        \Minify\Factory::registerPath($this->app->get('PATH_ROOT') . "public/Theme/");
        \Minify\Factory::registerPath($this->app->get('PATH_ROOT') . "public/Theme/css/");
        \Minify\Factory::registerPath($this->app->get('PATH_ROOT') . "public/");
        
        
        // add the media assets to be minified
        $files = array(
            'css/style.css'
        );
        
        foreach ($files as $file)
        {
            \Minify\Factory::css($file);
        }
        
        $files = array(
            'js/script.js'
        );
        
        foreach ($files as $file)
        {
            \Minify\Factory::js($file, array(
                'priority' => 1
            ));
        }