NAME

Web::AssetLib::OutputEngine - a base class for writing your own Output Engine

SYNOPSIS

package My::Library::OutputEngine;

use Method::Signatures;
use Moose;

extends 'Web::AssetLib::OutputEngine';

method export ( :$assets!, :$minifier? ) {
    # see Web::AssetLib::OutputEngine::LocalFile for examples
}

USAGE

If you have a need for a special file output scenario, you can simply extend this class, and it will plug in to the rest of the Web::AssetLib pipeline.

The only requirement is that your Output Engine implements the export method, which returns a properly-formatted HTML tag as a string.

IMPLEMENTATION

export

Process the arrayref of Web::AssetLib::Asset objects, and export a file with type $type. If $mininfier is provided (will be a Web::AssetLib::MinifierEngine instance), then it is your responsibility to call $minifier->minify().

export() should return a properly-formatted HTML tag as a string.

For help with common ouput operations, see the provided methods below.

METHODS

generateDigest

Pass in an arrayref of Web::AssetLib::Asset objects, and returns a string of the concatenated contents, and an MD5 digest string.

SEE ALSO

Web::AssetLib::OutputEngine::LocalFile

AUTHOR

Ryan Lang <rlang@cpan.org>