| 1 | # ----------------------------------------------------------------------------- | ||
| 2 | |||
| 3 | =encoding utf8 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Quiq::Html::Base - Basisklasse für HTML-Komponenten | ||
| 8 | |||
| 9 | =head1 BASE CLASS | ||
| 10 | |||
| 11 | L<Quiq::Hash> | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | Die Klasse ist die Basisklasse für alle HTML-Konstrukte, die aus | ||
| 16 | mehr als einem HTML-Tag aufgebaut sind und/oder eine komplexe | ||
| 17 | Logik besitzen, die durch eine Klasse gekapselt werden soll. | ||
| 18 | |||
| 19 | =head1 ATTRIBUTES | ||
| 20 | |||
| 21 | =over 4 | ||
| 22 | |||
| 23 | =item class => $class (Default: undef) | ||
| 24 | |||
| 25 | CSS-Klasse. | ||
| 26 | |||
| 27 | =item id => $str (Default: undef) | ||
| 28 | |||
| 29 | DOM-Id der Komponente. | ||
| 30 | |||
| 31 | =item cssPrefix => $str (Default: '') | ||
| 32 | |||
| 33 | Präfix für CSS-Klassennamen. Dieser Präfix wird den | ||
| 34 | CSS-Klassennamen vorangestellt. (MEMO: dieses Konzept ist zweifelhaft | ||
| 35 | und sollte abgeschafft werden) | ||
| 36 | |||
| 37 | =back | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | # ----------------------------------------------------------------------------- | ||
| 42 | |||
| 43 | package Quiq::Html::Base; | ||
| 44 | 11 | ▶ | use base qw/Quiq::Hash/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | |||
| 46 | 11 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 47 | 11 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | 11 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | |||
| 50 | 11 | our $VERSION = '1.240'; | |
| 51 | |||
| 52 | # ----------------------------------------------------------------------------- | ||
| 53 | |||
| 54 | =head1 METHODS | ||
| 55 | |||
| 56 | =head2 Konstruktor | ||
| 57 | |||
| 58 | =head3 new() - Konstruktor | ||
| 59 | |||
| 60 | =head4 Synopsis | ||
| 61 | |||
| 62 | $obj = $class->new(@keyVal); | ||
| 63 | |||
| 64 | =head4 Description | ||
| 65 | |||
| 66 | Instantiiere eine Html-Komponente mit allen Attributen (auch | ||
| 67 | der Subklasse) und liefere eine Referenz auf das Objekt zurück. | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | # ----------------------------------------------------------------------------- | ||
| 72 | |||
| 73 | 11 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 74 | 11 | my $class = shift; | |
| 75 | # @_: @keyVal | ||
| 76 | |||
| 77 | 11 | my $self = $class->SUPER::new( | |
| 78 | class => undef, | ||
| 79 | cssPrefix => undef, | ||
| 80 | id => undef, | ||
| 81 | ); | ||
| 82 | 11 | $self->unlockKeys; | |
| 83 | 11 | $self->set(@_); # Wir dürfen die Attribute beliebig erweitern | |
| 84 | 11 | $self->lockKeys; | |
| 85 | |||
| 86 | 11 | return $self; | |
| 87 | } | ||
| 88 | |||
| 89 | # ----------------------------------------------------------------------------- | ||
| 90 | |||
| 91 | =head1 VERSION | ||
| 92 | |||
| 93 | 1.240 | ||
| 94 | |||
| 95 | =head1 AUTHOR | ||
| 96 | |||
| 97 | Frank Seitz, L<http://fseitz.de/> | ||
| 98 | |||
| 99 | =head1 COPYRIGHT | ||
| 100 | |||
| 101 | Copyright (C) 2026 Frank Seitz | ||
| 102 | |||
| 103 | =head1 LICENSE | ||
| 104 | |||
| 105 | This code is free software; you can redistribute it and/or modify | ||
| 106 | it under the same terms as Perl itself. | ||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | # ----------------------------------------------------------------------------- | ||
| 111 | |||
| 112 | 11 | 1; | |
| 113 | |||
| 114 | # eof | ||