Mojolicious::Plugin::LinkedContent - manage linked css and js
use base 'Mojolicious'; sub statup { my $self = shift; $self->plugin( 'linked_content' ); }
Somewhere in template:
% require_js 'myscript.js';
And in <HEAD> of your layout:
% include_js;
Helps to manage scripts and styles included in document.
Add one or more js files to load queue.
Add one or more css files to load queue.
Render the plugin. Internal
Render queue to template
Internal method
Mojolicious::Plugin::LinkedContent can recieve parameters when loaded from Mojolicious like this:
$self->plugin( 'linked_content', 'js_base' => '/jsdir', 'css_base' => '/cssdir' );
If no basedirs provided, '/js' and '/css' used by default
Yaroslav Korshak <ykorshak@gmail.com>
<ykorshak@gmail.com>
Oliver Günther
Copyright (C) 2010 - 2013, Yaroslav Korshak
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Mojolicious::Plugin::LinkedContent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::LinkedContent
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::LinkedContent
For more information on module installation, please visit the detailed CPAN module installation guide.