Template::Declare::TagSet::HTML.3pm

Langue: en

Autres versions - même langue

Version: 2009-02-15 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Template::Declare::TagSet::HTML - Tag set for HTML

SYNOPSIS

     # normal use on the user side:
     use base 'Template::Declare';
     use Template::Declare::Tags 'HTML';
 
     template foo => sub {
         html {
             body {
             }
         }
     };
 
     # in Template::Declare::Tags:
 
     use Template::Declare::TagSet::HTML;
     my $tagset = Template::Declare::TagSet::HTML->new(
         { package => 'html', namespace => 'html' }
     );
     my $list = $tagset->get_tag_list();
     print "@$list";
 
     my $altern = $tagset->get_alternate_spelling('tr');
     if ( defined $altern ) {
         print $altern;
     }
 
     if ( $tagset->can_combine_empty_tags('img') ) {
         print "<img src='blah.gif' />";
     }
 
 

INHERITANCE

     Template::Declare::TagSet::HTML
         isa Template::Declare::TagSet
 
 

METHODS

"$obj = Template::Declare::TagSet::HTML->new({ namespace => $XML_namespace, package => $Perl_package })"
Constructor inherited from Template::Declare::TagSet.
"$list = $obj->get_tag_list()"
Returns an array ref for the tag names.

Out of the box, "Template::Declare::TagSet::HTML" returns the ":html2 :html3 :html4 :netscape" and ":form" tagsets from CGI.pm.

"$bool = $obj->get_alternate_spelling($tag)"
Returns the alternative spelling for a given tag if any or undef otherwise. Currently, "tr" is mapped to "row", "td" is mapped to "cell", and "base" is mapped to "html_base".

Because "tr" is reserved by the perl interpreter for the operator of that name. We can't override it. And we override "td" as well so as to keep consistent.

For similar reasons, 'base' often gives us trouble too ;)

"$bool = $obj->can_combine_empty_tags($tag)"

AUTHOR

Agent Zhang <agentzh@yahoo.cn>

SEE ALSO

Template::Declare::TagSet, Template::Declare::TagSet::XUL, Template::Declare::TagSet::RDF, Template::Declare::Tags, Template::Declare.