Inherits Plugin.

Public Member Functions | |
| tpHtml () | |
| head ($key, $val) | |
| js_run ($key, $code, $overwrite=true) | |
| js_load ($key, $path='') | |
| css_load ($key, $path='') | |
| css ($path) | |
| js ($path) | |
| favicon ($path) | |
| rss_feed ($url, $title) | |
| image ($path, $alt='', $attribs=array()) | |
| url ($url, $static=false) | |
| full_url ($url, $static=false) | |
| composite_url ($args, $base_url='') | |
| link ($text, $url, $confirm='', $popup=false, $attribs=array()) | |
| link_button ($text, $url, $icon='', $confirm='', $popup=false, $attribs=array()) | |
| button ($text, $url='', $confirm='', $popup=false, $formname='', $attribs=array()) | |
| tabs ($tabs) | |
| _popup_href ($popup, $url) | |
| _attribs ($attribs) | |
Public Attributes | |
| $guid = 1 | |
PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet
Description: Template plugin for common HTML elements.
Definition at line 10 of file html.php.
| tpHtml::button | ( | $ | text, | |
| $ | url = '', |
|||
| $ | confirm = '', |
|||
| $ | popup = false, |
|||
| $ | formname = '', |
|||
| $ | attribs = array() | |||
| ) |
Generate a button input tag
| string | $text Link text | |
| string | $url URL | |
| string | $confirm Popup confirmation before going to link | |
| bool | $popup Make link appear in a popup window | |
| string | $formanme If set, override the action of this form to point to the URL of this button, and submit the form. | |
| array | $attribs Additional HTML attributes |
| tpHtml::composite_url | ( | $ | args, | |
| $ | base_url = '' | |||
| ) |
Create a new URL by adding or substituting in new query arguments
| array | $args An associative array of name-value pairs of query arguments to add to $base_url | |
| string | $base_url The URL to start with before adding/modifying the query arguments (defaults to the current URI if left blnak) |
| tpHtml::css | ( | $ | path | ) |
Include a CSS file via a normal "link rel=stylesheet" tag.
| string | $path Path to CSS file, either absolute (http://...) or relative to base web root. |
Definition at line 89 of file html.php.
References url().
| tpHtml::css_load | ( | $ | key, | |
| $ | path = '' | |||
| ) |
Load an external CSS file through the next rendered template. This method is AJAX-friendly, i.e., it will work with both Page::render() and Page::ajax_render().
| string | $key A unique key for this CSS file. If blank, one will be auto-generated. | |
| string | The path to the CSS file. |
Definition at line 73 of file html.php.
References url().
| tpHtml::favicon | ( | $ | path | ) |
Include a favicon graphic via a "link rel=shortcut" tag.
| string | $path Path to favicon, either absolute (http://...) or relative to base web root. |
Definition at line 121 of file html.php.
References url().
| tpHtml::full_url | ( | $ | url, | |
| $ | static = false | |||
| ) |
Convert a URL to an absolute form, including http(s):// and FQDN
| string | $url | |
| bool | $static If true, ignore DISPATCH_URL even if it's set. This is needed for building URLs to static resources such as images, JS, CSS, things that shouldn't be routed through the DISPATCH_URL. |
Definition at line 196 of file html.php.
References absolute_url().
Referenced by rss_feed().
| tpHtml::head | ( | $ | key, | |
| $ | val | |||
| ) |
| tpHtml::image | ( | $ | path, | |
| $ | alt = '', |
|||
| $ | attribs = array() | |||
| ) |
Generate an img tag.
| string | $path Path to image, either absolute (http://...) or relative to base web root. | |
| string | $alt Text for ALT tag | |
| array | $attribs Additional HTML attributes |
Definition at line 155 of file html.php.
References _attribs(), and url().
| tpHtml::js | ( | $ | path | ) |
Include a JavaScript file via a "script src=" tag.
| string | $path Path to JS file, either absolute (http://...) or relative to base web root. |
Definition at line 105 of file html.php.
References url().
| tpHtml::js_load | ( | $ | key, | |
| $ | path = '' | |||
| ) |
Load an external JavaScript file through the next rendered template. This method is AJAX-friendly, i.e., it will work with both Page::render() and Page::ajax_render().
| string | $key A unique key for this JavaScript file. If blank, one will be auto-generated. | |
| string | The path to the JavaScript file. |
Definition at line 55 of file html.php.
References url().
| tpHtml::js_run | ( | $ | key, | |
| $ | code, | |||
| $ | overwrite = true | |||
| ) |
Set some JavaScript to be run by the next rendered template. This method is AJAX-friendly, i.e., it will work with both Page::render() and Page::ajax_render().
| string | $key A unique key for this JavaScript snippet. If blank, one will be auto-generated. | |
| string | $code The JavaScript code itself | |
| boolean | $overwrite If true, then this code will overwrite an existing snippet if they share the same key |
| tpHtml::link | ( | $ | text, | |
| $ | url, | |||
| $ | confirm = '', |
|||
| $ | popup = false, |
|||
| $ | attribs = array() | |||
| ) |
Generate an anchor/href tag
| string | $text Link text | |
| string | $url URL | |
| string | $confirm Popup confirmation before going to link | |
| mixed | $popup Make link appear in a popup window. If true, use default dimensions. If a string, use the specified dimensions (eg, "800x600"). | |
| array | $attribs Additional HTML attributes |
| tpHtml::link_button | ( | $ | text, | |
| $ | url, | |||
| $ | icon = '', |
|||
| $ | confirm = '', |
|||
| $ | popup = false, |
|||
| $ | attribs = array() | |||
| ) |
Generate a rounded-corner link with optional icon
| string | $text Link text | |
| string | $url URL | |
| string | $icon Icon image URL (optional) | |
| string | $confirm Popup confirmation before going to link | |
| mixed | $popup Make link appear in a popup window. If true, use default dimensions. If a string, use the specified dimensions (eg, "800x600"). | |
| array | $attribs Additional HTML attributes (for parent
) |
| tpHtml::rss_feed | ( | $ | url, | |
| $ | title | |||
| ) |
Generate an auto-discoverable RSS feed tag.
| string | $url URL to RSS feed | |
| string | $title Title of RSS feed |
Definition at line 137 of file html.php.
References full_url().
| tpHtml::tabs | ( | $ | tabs | ) |
Build a tabbed interface, with separate content under each tab.
| array | $tabs Array of arrays containing each tab definition. |
Example:
echo $html->tabs(array(
'tab1' => array('label'=>'First Tab', 'content'=>'<b>Hi!</b>'),
'tab2' => array('label'=>'Active Tab', 'content'=>'Can you see me?', 'active'=>true),
));
Definition at line 360 of file html.php.
References $guid.
| tpHtml::tpHtml | ( | ) |
| tpHtml::url | ( | $ | url, | |
| $ | static = false | |||
| ) |
Convert a URL to an absolute form, path only (no http:// or FQDN)
| string | $url | |
| bool | $static If true, ignore DISPATCH_URL even if it's set. This is needed for building URLs to static resources such as images, JS, CSS, things that shouldn't be routed through the DISPATCH_URL. |
Definition at line 181 of file html.php.
Referenced by css(), css_load(), favicon(), image(), js(), and js_load().
1.6.1