PHP Classes
Icontem

File: example.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrey Nikishaev  >  JS & CSS Compressor  >  example.php  
File: example.php
Role: Example script
Content type: text/plain
Description: example of using class
Class: JS & CSS Compressor
Merge and compress Javascript(JS) and CSS files
 

Contents

Class file image Download
<?php
include('js_merge.php');
//include('js_merge_php4.php'); //for php4


$arr=array("someJS1.js","js/someJS2.js");
$a=new jsCssCompressor();
$a->makeJs($arr,"js/a.js");

// or if CSS $a->makeCss($arr,"js/a.js");

/* or
jsCssCompressor::makeJs($arr,"js/a.js");

or if CSS

jsCssCompressor::makeCss($arr,"js/a.js");
   
*/

/*
for compressing from data and output as a file for save.

$data="some string";
header("Content-Disposition: attachment; filename=compressed.js");
echo jsCssCompressor::compressJs($data);

or if CSS

$data="some string";
header("Content-Disposition: attachment; filename=compressed.css");
echo jsCssCompressor::compressCss($data);
*/

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products