Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (29 sloc) 0.771 kb
<?php
/**
*
* Fragment objects.
*
*/
class CssCrush_Fragment
{
public $template = array();
public $arguments;
public function __construct ( $block )
{
// Prepare the arguments object
$this->arguments = new CssCrush_ArgList( $block );
// Re-assign with the parsed arguments string
$this->template = $this->arguments->string;
}
public function call ( array $args )
{
// Copy the template
$template = $this->template;
if ( count( $this->arguments ) ) {
list( $find, $replace ) = $this->arguments->getSubstitutions( $args );
$template = str_replace( $find, $replace, $template );
}
// Return fragment css
return $template;
}
}
Jump to Line
Something went wrong with that request. Please try again.