PHP Classes

File: sample/sample.php

Recommend this page to a friend!
  Classes of Rogério Taques   PHP Minify CSS and JavaScript   sample/sample.php   Download  
File: sample/sample.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Minify CSS and JavaScript
Compact and group CSS and JavaScript files
Author: By
Last change: Update of sample/sample.php
Date: 1 year ago
Size: 537 bytes
 

Contents

Class file image Download
<?php

require_once('../minifyr.php');

// get settings and files to minify
// options are:
// f - Required. File or comma separated file list
// screen - Optional. Void. Forces the download of minified file.
// debug - Optional. Void. When given, skip minification.

$debug = isset( $_GET[ 'debug' ] ) ? TRUE : FALSE;
$screen = isset( $_GET[ 'screen' ] ) ? TRUE : FALSE;
$files = isset( $_GET[ 'f' ] ) ? $_GET[ 'f' ] : NULL;

$m = new RT\Minifyr($debug, $screen);
$m->files( explode(',', $files) )->uglify(true)->render();

?>