NAME
Web::AssetLib::Util - core utilties for Web::AssetLib
FUNCTIONS
normalizeFileType
my $type = normalizeFileType( 'stylesheet' );
# $type = 'css'
Converts file type string to a normalized version of that string. e.g. "javascript" maps to "js"
normalizeMimeType
my $mime = normalizeMimeType( 'stylesheet' );
# $mime = 'text/css'
Converts file type string to a mime type. e.g. "javascript" maps to "text/javascript"
generateHtmlTag
my $output = ... # a Web::AssetLib::Output object
my $tag = generateHtmlTag(
output => $output,
html_attrs => { async => 'async' }
);
Generates an HTML tag for a Web::AssetLib::Output object. Optionally, html_attrs
can be provided.
AUTHOR
Ryan Lang <rlang@cpan.org>