<<

NAME

Koha::Template::Plugin::Asset

DESCRIPTION

The Asset plugin is a helper that generates HTML tags for JS and CSS files

SYNOPSYS

    [% USE Asset %]

    [% Asset.css("css/datatables.css") %]
    [% Asset.js("js/datatables.js") %]

    [%# With attributes %]
    [% Asset.css("css/print.css", { media = "print" }) %]

    [%# If you only want the url and not the HTML tag %]
    [% url = Asset.url("css/datatables.css") %]

FUNCTIONS

new

Constructor. Do not use this directly.

js

Returns a <script> tag for the given JS file

    [% Asset.js('js/datatables.js') %]

css

Returns a <link> tag for the given CSS file

    [% Asset.css('css/datatables.css') %]
    [% Asset.css('css/print.css', { media = "print" }) %]

url

Returns the URL for the given file

    [% Asset.url('css/datatables.css') %]

_tag

Returns an HTML tag with given name and attributes. This shouldn't be used directly.

<<