Changes

Jump to navigation Jump to search
Line 20: Line 20:     
=== SYNTAX ===
 
=== SYNTAX ===
Through the magic of autoloading, this class can make any html tag by calling a class method with the same name as the tag you want.  For examples, use "hr()" to make a "<HR>" tag, or "p(’text’)" to make "<P>text</P>".  This also means that if you mis-spell any method name, it will still make a new tag with the mis-spelled name. For autoloaded methods only, the method names are case-insensitive.
+
<nowiki>Through the magic of autoloading, this class can make any html tag by calling a class method with the same name as the tag you want.  For examples, use "hr()" to make a "<HR>" tag, or "p(’text’)" to make "<P>text</P>".  This also means that if you mis-spell any method name, it will still make a new tag with the mis-spelled name. For autoloaded methods only, the method names are case-insensitive.
    
If you call a class method whose name ends in either of [’_start’, ’_end’, ’_pair’], this will be interpreted as an instruction to make just part of one tag whose name are the part of the method name preceeding that suffix.  For example, calling "p_start( ’text’ )" results in "<P>text" rather than "<P>text</P>".  Similarly, calling "p_end()" will generate a "</P>" only.  Using the ’_pair’ suffix will force tags to be made as a pair, whether or not they would do so naturally.  For example, calling "br_pair" would produce a "<BR></BR>" rather than the normal "<BR>".  When using either of [’_start’,’_pair’], the arguments you pass the method are exactly the same as the unmodified method would use, and there are no other symantec differences.  However, when using the ’_end’ suffix, any arguments are ignored, as the latter member of a tag pair never carries any attributes anyway.
 
If you call a class method whose name ends in either of [’_start’, ’_end’, ’_pair’], this will be interpreted as an instruction to make just part of one tag whose name are the part of the method name preceeding that suffix.  For example, calling "p_start( ’text’ )" results in "<P>text" rather than "<P>text</P>".  Similarly, calling "p_end()" will generate a "</P>" only.  Using the ’_pair’ suffix will force tags to be made as a pair, whether or not they would do so naturally.  For example, calling "br_pair" would produce a "<BR></BR>" rather than the normal "<BR>".  When using either of [’_start’,’_pair’], the arguments you pass the method are exactly the same as the unmodified method would use, and there are no other symantec differences.  However, when using the ’_end’ suffix, any arguments are ignored, as the latter member of a tag pair never carries any attributes anyway.
Line 27: Line 27:  
The number of tags produced is equal to the length of the longest ARRAY ref passed as an argument.  For any other arguments who have fewer than this count, their last value is replicated and appended enough times as necessary to make them the same length.  The value of a scalar argument is used for all the tags.  For example, calling "input_group( type => checkbox, name => ’letters’, value => [’a’,’b’,’c’] )" produces ’<INPUT TYPE="checkbox" NAME="letters" VALUE="a"><INPUT TYPE="checkbox" NAME="letters" VALUE="b"><INPUT TYPE="checkbox" NAME="letters" VALUE="c">’.
 
The number of tags produced is equal to the length of the longest ARRAY ref passed as an argument.  For any other arguments who have fewer than this count, their last value is replicated and appended enough times as necessary to make them the same length.  The value of a scalar argument is used for all the tags.  For example, calling "input_group( type => checkbox, name => ’letters’, value => [’a’,’b’,’c’] )" produces ’<INPUT TYPE="checkbox" NAME="letters" VALUE="a"><INPUT TYPE="checkbox" NAME="letters" VALUE="b"><INPUT TYPE="checkbox" NAME="letters" VALUE="c">’.
 
All autoloaded methods require their parameters to be in named format.  These names and values correspond to attribute names and values for the new tags.  Since "no value" attributes are essentially booleans, they can have any true or false value associated with them in the parameter list, which won’t be printed.  If an autoloaded method is passed exactly one parameter, it will be interpreted as the "text" that goes between the tag pair (<TAG>text</TAG>) or after "start tags" (<TAG>text).  The same result can be had explicitely by passing the named parameter "text".  Most static (non-autoloaded) methods require positional parameters, except for start_html(), which can take either format.  The names of any named parameters can optionally start with a "-".
 
All autoloaded methods require their parameters to be in named format.  These names and values correspond to attribute names and values for the new tags.  Since "no value" attributes are essentially booleans, they can have any true or false value associated with them in the parameter list, which won’t be printed.  If an autoloaded method is passed exactly one parameter, it will be interpreted as the "text" that goes between the tag pair (<TAG>text</TAG>) or after "start tags" (<TAG>text).  The same result can be had explicitely by passing the named parameter "text".  Most static (non-autoloaded) methods require positional parameters, except for start_html(), which can take either format.  The names of any named parameters can optionally start with a "-".
 +
</nowiki>
 +
 
=== FUNCTIONS AND METHODS ===
 
=== FUNCTIONS AND METHODS ===
 
Note that all the methods defined below are static, so information specific to autoloaded methods won’t likely apply to them.  All of these methods take positional arguments unless otherwise specified.
 
Note that all the methods defined below are static, so information specific to autoloaded methods won’t likely apply to them.  All of these methods take positional arguments unless otherwise specified.

Navigation menu