Name
HTML::Accessors - Generate HTML elements
Version
Describes version v0.11.$Rev: 1 $ of HTML::Accessors
Synopsis
use HTML::Accessors;
my $my_obj = HTML::Accessors->new();
# Create an anchor element
$anchor = $my_obj->a( { href => 'http://...' }, 'This is a link' );
Description
Uses HTML::GenerateUtil to create an autoload method for each of the
elements defined by HTML::Tagset. The API was loosely taken from CGI.
Using the CGI module is undesirable in a Catalyst application (run from
the development server) due go greediness issues over STDIN.
The returned tags are either XHTML 1.1 or HTML 4.01 compliant.
Configuration and Environment
The constructor defines accessors and mutators for one attribute:
"content_type"
Defaults to *application/xhtml+xml* which causes the generated tags
to conform to the XHTML standard. Setting it to *text/html* will
generate HTML compatible tags instead
Subroutines/Methods
new
my $my_obj = HTML::Accessors->new( content_type => q(application/xhtml+xml) );
Uses "_arg_list" to process the passed options
content_type
$content_type = $self->content_type( $new_type );
Accessor / mutator for the "content_type" attribute
escape_html
my $escaped_html = $my_obj->escape_html( $unescaped_html );
Expose the method escape_html
is_xml
my $bool = $my_obj->is_xml;
Returns true if the returned tags will be XHTML. Matches the string
*.xml* at the end of the *content_type*
popup_menu
my $html = $my_obj->popup_menu( default => $value, labels => {}, values => [] );
Returns the "