- NAME
- SYNOPSIS
- DESCRIPTION
- INTERFACE
- HELPERS
- CONFIGURATION AND ENVIRONMENT
- AUTHOR
- CREDITS
- LICENCE AND COPYRIGHT
Mojolicious::Plugin::LinkedContent - manage linked css and js
use base 'Mojolicious';
sub statup {
my $self = shift;
$self->plugin( 'linked_content' );
}
Somewhere in template:
% require_css 'mypage.css';
% require_js 'myscript.js';
% require_reg 'bootstrap';
And in <HEAD> of your layout:
%== include_css;
%== include_js;
Helps to manage scripts and styles included in document.
- require_js
-
Add one or more js files to load queue.
- require_css
-
Add one or more css files to load queue.
- require_reg
-
Add a library and its dependences based on reg_config file
- register
-
Render the plugin. Internal
- include_js =item include_css
-
Render queue to template
- store_items
-
Internal method
Mojolicious::Plugin::LinkedContent can recieve parameters when loaded from Mojolicious like this:
$self->plugin(
'linked_content',
'js_base' => '/jsdir',
'css_base' => '/cssdir'
'reg_config' => '/linked_content.cfg',
);
If no basedirs provided, '/js' and '/css' used by default. If no reg_config is provided a cloud example file is used. Default reg_config URL: https://raw.githubusercontent.com/EmilianoBruni/MPLConfig/main/linked_content.cfg
Yaroslav Korshak <[email protected]>
, Emiliano Bruni <[email protected]
Oliver Günther
Copyright (C) 2010 - 2013, Yaroslav Korshak Copyright (C) 2019 - 2021, Emiliano Bruni
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.