Tags::HTML::Element::A - Tags helper for HTML a element.
use Tags::HTML::Element::A; my $obj = Tags::HTML::Element::A->new(%params); $obj->cleanup; $obj->init($a); $obj->prepare; $obj->process; $obj->process_css;
new
my $obj = Tags::HTML::Element::A->new(%params);
Constructor.
css
CSS::Struct::Output object for process_css processing.
Default value is undef.
tags
Tags::Output object.
cleanup
$obj->cleanup;
Process cleanup after page run.
In this case cleanup internal representation of a set by init.
Returns undef.
init
$obj->init($a);
Process initialization in page run.
Accepted $a is Data::HTML::Element::A.
$a
prepare
$obj->prepare;
Process initialization before page run.
Do nothing in this object.
process
$obj->process;
Process Tags structure for HTML a element to output.
Do nothing in case without inicialization by init.
process_css
$obj->process_css;
Process CSS::Struct structure for HTML a element to output.
new(): From Tags::HTML::new(): Parameter 'css' must be a 'CSS::Struct::Output::*' class. Parameter 'tags' must be a 'Tags::Output::*' class. Input object must be a 'Data::HTML::Element::A' instance. process(): From Tags::HTML::process(): Parameter 'tags' isn't defined. process_css(): From Tags::HTML::process_css(): Parameter 'css' isn't defined.
use strict; use warnings; use CSS::Struct::Output::Indent; use Data::HTML::Element::A; use Tags::HTML::Element::A; use Tags::Output::Indent; # Object. my $css = CSS::Struct::Output::Indent->new; my $tags = Tags::Output::Indent->new( 'xml' => 1, ); my $obj = Tags::HTML::Element::A->new( 'css' => $css, 'tags' => $tags, ); # Data object for a. my $a = Data::HTML::Element::A->new( 'css_class' => 'a', 'data' => ['Link'], 'url' => 'http://example.com', ); # Initialize. $obj->init($a); # Process a. $obj->process; $obj->process_css; # Print out. print "HTML:\n"; print $tags->flush; print "\n\n"; print "CSS:\n"; print $css->flush; # Output: # HTML: # <a class="a" href="http://example.com"> # Link # </a> # # CSS: # - no CSS now.
Class::Utils, Error::Pure, Scalar::Util, Tags::HTML.
https://github.com/michal-josef-spacek/Tags-HTML-Element
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2022-2024 Michal Josef Špaček
BSD 2-Clause License
0.12
To install Tags::HTML::Element, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tags::HTML::Element
CPAN shell
perl -MCPAN -e shell install Tags::HTML::Element
For more information on module installation, please visit the detailed CPAN module installation guide.