Inherited Variables | Inherited Methods |
This class is designed to make generating HTML output in MDPro very simple and also allow for much greater control of output by the site administrator.
Example
// Information array
$colors = array(array('id' => 1,
'name' => 'Red',
'encoding' => 'ff0000'),
array('id' => 2,
'name' => 'Blue',
'encoding' => '00ff00'),
array('id' => 3,
'name' => 'Green',
'encoding' => '0000ff'));
// Create the HTML object and start it
$myhtml = new pnHTML();
$myhtml->Start();
// Add table showing encoding information
$myhtml->TableStart('Colors and Their Encodings', array('Color', 'Encoding'));
foreach ($colors as $color) {
$info = array($color['name'], $color['encoding']);
$myhtml->TableAddRow($info);
}
$myhtml->TableEnd();
// Add form to select a color
$myhtml->Text('<P><P>');
$myhtml->FormStart('colorchosen.php');
$myhtml->Text('Select a color: ');
$myhtml->FormList('chosen', $colorinfo);
$myhtml->FormSubmit('That's the color I want');
$myhtml->FormEnd();
// End the HTML object and print it
$myhtml->End();
$myhtml->PrintPage();
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $text | the text string to add |
|
| access: | public |
| string | $confirm_text | Confirmation message to display |
| string | $confirm_url | URL to go to if confirm button is clicked |
| string | $cancel_text | Link text cor the cancel message |
| string | $cancel_url | URL to go to is action is canceled |
| array | $arg | An array of args to create hidden fields for |
|
| return: | An HTML string if has been called, otherwise null |
| see: | pnHTML::StartPage() |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| since: | 1.13 - 2002/01/23 |
| access: | public |
| string | $fieldname | the name of the checkbox field |
| string | $value | (optional) the value of the checkbox field |
| boolean | $checked | (optional) the field is checked |
| string | $type | (optional) the type of field this is, either or
|
| string | $accesskey | (optional) accesskey to active this item |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| since: | 1.13 - 2002/01/23 |
| access: | public |
| string | $fieldname | the name of the field |
| integer | $size | (optional) the size of the field on the page in number of characters |
| integer | $maxsize | (optional) the maximum file size allowed (in bytes) |
| string | $accesskey | (optional) accesskey to active this item |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| mixed | $fieldname | the name of the hidden field. can also be an array. |
| string | $value | the value of the hidden field |
|
| return: | An HTML string if has been called, otherwise null |
| since: | 1.13 - 2002/01/23 |
| access: | public |
| string | $fieldname | the name of the select field |
| array | $data | an array containing the data for the list. Each array entry is itself an array, containing the values for (the value returned if the entry is selected), (the string displayed for this entry) and (optional, if this option is selected) |
| integer | $multiple | (optional) if the user is allowed to make multiple selections |
| integer | $size | (optional) the number of entries that are visible in the select at any one time. Note that if the number of actual items is less than this value then the select box will shrink automatically to the correct size |
| string | $selected | (optional) selected value of
|
| string | $accesskey | (optional) accesskey to active this item |
| string | $events: | javascript events |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $action | the URL that this form should go to on submission |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $label | (optional) the name of the submission button. This defaults to
|
| string | $accesskey | (optional) accesskey to active this button |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $fieldname | the name of the text field |
| string | $contents | (optional) the inital value of the text field |
| integer | $size | (optional) the size of the text field on the page in number of characters |
| integer | $maxlength | (optional) the maximum number of characters the text field can hold |
| boolean | $password | (optional) field acts as a password field |
| string | $accesskey | (optional) accesskey to active this item |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $fieldname | the name of the text area filed |
| string | $contents | the initial value of the text area field |
| integer | $rows | the number of rows that the text area | should cover |
| integer | $cols | the number of columns that the text area | should cover |
| string | $wrap | (optional) wordwrap mode to use, either or
|
| string | $accesskey | (optional) accesskey to active this item |
|
| return: | Current input state |
| see: | pnHTML::SetInputMode() |
| since: | 1.13 - 2002/01/23 |
| access: | public |
|
Note that this function does not clear out the object's buffer.
| return: | An HTML string |
| since: | 1.15 - 2002/01/30 |
| access: | public |
|
| return: | Current output state |
| see: | pnHTML::SetOutputMode() |
| since: | 1.13 - 2002/01/23 |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| integer | $numbreaks | number of linebreaks to add |
|
| since: | 1.13 - 2002/01/23 |
| author: | Greg 'Adam Baum' |
| access: | public |
| integer | $startnum | start item |
| integer | $total | total number of items present |
| string | $urltemplate | template for url, will replace '%%' with item number |
| integer | $perpage | number of links to display (default=10) |
|
Note that this function does not clear out the object's buffer.
| access: | public |
|
This function is broken, do not use it!
| return: | An HTML string if has been called, otherwise null |
| todo: | This function is broken, do not use it! |
| access: | public |
| string | $url | URL to redirect to |
| integer | $waittime | Seconds to wait before redirecting |
|
| return: | Previous state |
| see: | pnHTML::GetInputMode() |
| since: | 1.14 - 2002/01/29 |
| access: | public |
| int | $st | Input state to set to |
|
| return: | Previous state |
| see: | pnHTML::GetOutputMode() |
| since: | 1.14 - 2002/01/29 |
| access: | public |
| int | $st | Output state to set to |
|
| return: | An HTML string if has been called, otherwise null |
| see: | pnHTML::EndPage() |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| array | $row | an array of row entries |
| string | $align | (optional) the alignment of the row, which can be one of , or
|
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| integer | $colspan | number of columns that this column spans |
| string | $align | Horizantal alignment of the column |
| string | $valign | Vertical alignment of this column |
| integer | $rowspan | Total rows this column uses |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $align | Default horizantal alignment for all columns on this row |
| string | $valign | Default vertical alignment for all columns on this row |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $title | the title of the table |
| array | $headers | an array of column headings |
| integer | $border | size of table borders |
| string | $width | the width of the table. can be null if no width needs to be specified |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $text | The text string to add |
|
| return: | An HTML string if has been called, otherwise null |
| access: | public |
| string | $text | the text string to add |
|
| return: | Always returns true |
| see: | pnHTML::FormStart(), pnHTML::FormFile() |
| since: | 1.13 - 2002/01/23 |
| access: | public |
|
| return: | An HTML string if has been called, otherwise null |
| since: | 1.13 - 2002/01/23 |
| access: | public |
| string | $url | the URL of the link |
| string | $text | the text that the URL is anchored to |