PET::Util::EHTML

PET::Util::EHTML

PET Util package for manipulating HTML -- mostly forms.

Summary
PET::Util::EHTMLPET Util package for manipulating HTML -- mostly forms.
Functions
NAME
bodySelect (%p)Creates a <select>...</select> tag, using various parameters.
addAttributes (%p)Adds (x)html attributes to tag.
onhref (%p)This is mostly used for denoting the currently active menu.

Functions

NAME

sub NAME

bodySelect (%p)

sub bodySelect

Creates a <select>...</select> tag, using various parameters.

Parameters

_body : value option [separated by a whitespace -- value must be \w+ ] separator : value-option separator override selected : the selected option, if any array : optional, used if not _body is passed; format is FIXME <all_other> : all other parameters (e.g.  “class”) are put in “as is”

Returns

string

addAttributes (%p)

sub addAttributes

Adds (x)html attributes to tag.  Returns a string.

E.g.  ‘a’ => ‘b’ is converted to a=”b”

onhref (%p)

sub onhref

This is mostly used for denoting the currently active menu.  More prcisely: an “<a href...>” tag is shown if the given textlink is NOT the same as the current URL.

Example

<ehtml:onhref link=”/a/b.pet” linktext=”go here” text=”you are here” />

Only works with url-base absolute menus currently!

Input parameters

  • url (to link to, e.g.  “/this/sub/menu.pet”)
  • textoff (the link-text to show when we are on a different url)
  • texton (the text to show when we are at the url corresponding to the url parameter)
  • text (same text shown for texton/textoff)
Base class for all Util modules.
sub NAME
sub bodySelect
Creates a select...</select> tag, using various parameters.
sub addAttributes
Adds (x)html attributes to tag.
sub onhref
This is mostly used for denoting the currently active menu.
Close