The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Quiq::Html::Resources - CSS- und JavaScript-Resourcen einer Webapplikation

BASE CLASS

Quiq::Hash

DESCRIPTION

Ein Objekt der Klasse ist ein Speicher für die Definition von CSS- und JavaScript-Ressourcen. Die Ressourcen werden unter einem Schlüssel $key, z.B. 'jquery' oder 'jquery-ui', im Speicher abgelegt und nach ihrem Typ (css, js) unterschieden.

EXAMPLE

use Quiq::Html::Resources;

# Instantiiere Objekt (hier am Beispiel der Resourcen 'jquery'
# und 'jquery-ui')

my $res = Quiq::Html::Resources->new(
    jquery => {
        js => [
            'https://code.jquery.com/jquery-latest.min.js',
        ],
    },
    'jquery-ui' => {
        css => [
            'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css',
        ],
        js => [
            'https://code.jquery.com/ui/1.12.1/jquery-ui.min.js',
        ],
    },
);

my @cssResources = $res->resources('jquery-ui','css');
# ('https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css')

my @jsResources = $res->resources('jquery-ui','js');
# ('https://code.jquery.com/ui/1.12.1/jquery-ui.css')

METHODS

Konstruktor

new() - Instantiiere Objekt

Synopsis

$res = $class->new($key=>\%typeArr,...);

Description

Instantiiere ein Objekt der Klasse und liefere eine Referenz auf dieses Objekt zurück.

Objektmethoden

resources() - Liefere Liste von Ressourcen

Synopsis

@arr | $arr = $res->resources(@keys);

Arguments

@keys

Liste von Schlüsseln, z.B. 'jquery', 'datatables'.

Description

Liefere die Liste der Ressourcen zu den Schlüsseln @keys.

VERSION

1.220

AUTHOR

Frank Seitz, http://fseitz.de/

COPYRIGHT

Copyright (C) 2024 Frank Seitz

LICENSE

This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.