public function addAsset(array $asset)
    {
        if (!isset($asset['input'])) {
            throw new \InvalidArgumentException('Asset needs an input.');
        }
        if (!isset($asset['name'])) {
            $asset['name'] = uniqid();
        }
        if (!isset($asset['filter'])) {
            $asset['filter'] = array();
        }
        if (!is_array($asset['filter'])) {
            $asset['filter'] = explode(',', $asset['filter']);
        }
        if (!isset($asset['options']) || !is_array($asset['options'])) {
            $asset['options'] = array();
        }
        if (!isset($asset['options']['output']) && isset($asset['output'])) {
            $asset['options']['output'] = $asset['output'];
        }

        $this->manager->setFormula($asset['name'], array(
            $asset['input'],
            $asset['filter'],
            $asset['options']
        ));
    }
public function addAsset(array $asset)
    {
        if (!isset($asset['input'])) {
            throw new \InvalidArgumentException('Asset needs an input.');
        }
        if (!isset($asset['name'])) {
            $asset['name'] = uniqid();
        }
        if (!isset($asset['filter'])) {
            $asset['filter'] = array();
        }
        if (!is_array($asset['filter'])) {
            $asset['filter'] = explode(',', $asset['filter']);
        }
        if (!isset($asset['options']) || !is_array($asset['options'])) {
            $asset['options'] = array();
        }
        if (!isset($asset['options']['output']) && isset($asset['output'])) {
            $asset['options']['output'] = $asset['output'];
        }

        $this->manager->setFormula($asset['name'], array(
            $asset['input'],
            $asset['filter'],
            $asset['options']
        ));
    }
public function addAsset ( array $ asset ) { if ( ! isset ( $ asset [ 'input' ] ) ) { throw new \ InvalidArgumentException ( 'Asset needs an input.' ) ; } if ( ! isset ( $ asset [ 'name' ] ) ) { $ asset [ 'name' ] = uniqid ( ) ; } if ( ! isset ( $ asset [ 'filter' ] ) ) { $ asset [ 'filter' ] = array ( ) ; } if ( ! is_array ( $ asset [ 'filter' ] ) ) { $ asset [ 'filter' ] = explode ( ',' , $ asset [ 'filter' ] ) ; } if ( ! isset ( $ asset [ 'options' ] ) || ! is_array ( $ asset [ 'options' ] ) ) { $ asset [ 'options' ] = array ( ) ; } if ( ! isset ( $ asset [ 'options' ] [ 'output' ] ) && isset ( $ asset [ 'output' ] ) ) { $ asset [ 'options' ] [ 'output' ] = $ asset [ 'output' ] ; } $ this -> manager -> setFormula ( $ asset [ 'name' ] , array ( $ asset [ 'input' ] , $ asset [ 'filter' ] , $ asset [ 'options' ] ) ) ; }
Adds an asset to be processed by the asset writer.

Accepted keys in the asset array are:
* `name`: the name of the asset
* `input`: the input assets (required)
* `filter`: the assetic filters to be applied (by default)
* `output`: the output path (by default the same as input)
* `options`: other asset options

@param array asset the asset configuration
Adds an asset to be processed by the asset writer .