tpHtml Class Reference

Inherits Plugin.

Collaboration diagram for tpHtml:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet

Author:
Judd Vinet <jvinet@zeroflux.org>

Description: Template plugin for common HTML elements.

Definition at line 10 of file html.php.


Member Function Documentation

tpHtml::_attribs ( attribs  ) 

Definition at line 407 of file html.php.

Referenced by image().

tpHtml::_popup_href ( popup,
url 
)

Definition at line 390 of file html.php.

tpHtml::button ( text,
url = '',
confirm = '',
popup = false,
formname = '',
attribs = array() 
)

Generate a button input tag

Parameters:
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
Returns:
string

Definition at line 317 of file html.php.

tpHtml::composite_url ( args,
base_url = '' 
)

Create a new URL by adding or substituting in new query arguments

Parameters:
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)
Returns:
string The final URL

Definition at line 210 of file html.php.

References $args, $p, and $parts.

tpHtml::css ( path  ) 

Include a CSS file via a normal "link rel=stylesheet" tag.

Parameters:
string $path Path to CSS file, either absolute (http://...) or relative to base web root.
Returns:
string

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().

Parameters:
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.

Parameters:
string $path Path to favicon, either absolute (http://...) or relative to base web root.
Returns:
string

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

Parameters:
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.
Returns:
string

Definition at line 196 of file html.php.

References absolute_url().

Referenced by rss_feed().

tpHtml::head ( key,
val 
)

Insert some HTML into the HEAD of the rendered layout/template.

Parameters:
string $key A unique key for this code or HTML
string $val The code/HTML itself

Definition at line 27 of file html.php.

tpHtml::image ( path,
alt = '',
attribs = array() 
)

Generate an img tag.

Parameters:
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
Returns:
string

Definition at line 155 of file html.php.

References _attribs(), and url().

tpHtml::js ( path  ) 

Include a JavaScript file via a "script src=" tag.

Parameters:
string $path Path to JS file, either absolute (http://...) or relative to base web root.
Returns:
string

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().

Parameters:
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().

Parameters:
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

Definition at line 42 of file html.php.

tpHtml::link ( text,
url,
confirm = '',
popup = false,
attribs = array() 
)

Generate an anchor/href tag

Parameters:
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
Returns:
string

Definition at line 253 of file html.php.

tpHtml::link_button ( text,
url,
icon = '',
confirm = '',
popup = false,
attribs = array() 
)

Generate a rounded-corner link with optional icon

Parameters:
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

)
Returns:
string

Definition at line 282 of file html.php.

tpHtml::rss_feed ( url,
title 
)

Generate an auto-discoverable RSS feed tag.

Parameters:
string $url URL to RSS feed
string $title Title of RSS feed
Returns:
string

Definition at line 137 of file html.php.

References full_url().

tpHtml::tabs ( tabs  ) 

Build a tabbed interface, with separate content under each tab.

Parameters:
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 (  ) 

Constructor

Definition at line 17 of file html.php.

References Plugin::Plugin().

tpHtml::url ( url,
static = false 
)

Convert a URL to an absolute form, path only (no http:// or FQDN)

Parameters:
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.
Returns:
string

Definition at line 181 of file html.php.

Referenced by css(), css_load(), favicon(), image(), js(), and js_load().


Member Data Documentation

tpHtml::$guid = 1

Definition at line 12 of file html.php.

Referenced by tabs().


The documentation for this class was generated from the following file:

Generated on Wed Jan 13 09:21:05 2010 for Pronto Framework by  doxygen 1.6.1