PHP code example of clancats / packtacular

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

    

clancats / packtacular example snippets


Packtacular::storage( $_SERVER['DOCUMENT_ROOT'].'/' );

// When you pass relative paths packtacular is going to prefix your path
// with the storage directory. `<storage>/assets/css/`
Packtacular::css( 'assets/css/', 'cache/stylesheet_:time.css' )

Packtacular::js( array(
	'js/jquery.js',
	'js/myscript.js',
), 'cache/:time/core.js' );

Packtacular::filter( '<type>', function( $data ) 
{	
	// do something with $data
	return $data;
});

// This little example will add a comment above each file 
// containing the file path of the current file.
Packtacular::filter( '*', function( $data, $file_name ) 
{	
	return "/* ".$file_name." */\n".$buffer;
}, true );

// This little example will only be executed on the entire package.
Packtacular::filter( 'css', function( $data ) 
{	
	return str_replace( ' ', '', $data );
});

Packtacular_Filter::add( 'comments' );