Represents a web page. This class is primarily concerned with making sure that the things in the HEAD part of the page are set up correctly.
OnInit | Fired when a page object is first created. |
InitComplete | Fired after object initialization is complete. |
OnOutput | Fired when processing for HTML output starts. |
OutputComplete | Fired after the HTML output has been performed. |
Holds a reference to the primary object which is displayed on this page. The type of object will vary from page to page and may be set to false on some pages. For most pages, it will be the current Blog object, but BlogEntry and Article object are also common.
String holding the DOCTYPE for the page. Should normally be set using a named constant.
A string used for the page title.
Represents the MIME type of the page.
Holds the character encoding to use for the page.
Get the instance for the page singleton.
public function addPackage( |
| ) |
Adds a third-party package to the page, e.g. jQuery.
name string$ | The name of the package to add |
public function setDisplayObject( |
| ) |
Sets the object which the page is currently displaying.
ref | A reference to the object to set. |
Adds style sheets to be link into the page.
Takes a variable number of string parameters, each representing the filename of a CSS file.
Adds style sheets to be added inline into the page.
Takes a variable number of string parameters, each containing the CSS code to use for the inline styles.
public function addLink( |
| ) |
Adds a generic link element to the page header.
attribs | An associative array, with each key corresponding to an attribute of the link with the corresponding value as the value. |
public function addRSSFeed( |
| ) |
Adds an RSS feed to the link elements of the page header.
href | The URL of the feed file. |
type | The MIME type of the feed, e.g. application/xml or application/rss+xml |
title | The title for the feed. |
public function addScript( |
| ) |
Adds a script file to the header of the page.
href | The URL of the script file. |
type | Optional MIME type of the script. The default is text/javascript. |
public function addInlineScript( |
| ) |
Adds an inline script to the header of the page.
text | The text of the script to add inline. |
type | Optional MIME type of the script. The default is text/javascript. |
public function addExternalScript( |
| ) |
Add a script file from an external URL to the page.
public function addExternalStylesheet( |
| ) |
Add a stylesheet from an external URL to the page.
public function addScriptFirst( |
| ) |
Like addScript, except adds the script at the beginning of the list of scripts to be inserted. Use this for initialization of configuration scripts that need to run before other things.
public function addInlineScriptFirst( |
| ) |
Like addScriptFirst, except for inline scripts.
public function addMeta( |
| ) |
Adds a META item to the page.
content | The content of the meta tag. |
name | Optional name attribute. |
httpequiv | Optional http-equiv attribute. |
public function addHeader( |
| ) |
Add an item to the HTTP header for the page.
name | The header name. |
content | The content of the header. |
public function redirect( |
| ) |
Redirect to another page.
url | The target URL to which to redirect. |
public function refresh( |
| ) |
Refresh the page.
url | The URL of the page to refresh. |
delay | Optional delay of refresh. Default is 0. |
public function display( |
| ) |
Displays the page, i.e. sends it to the browser.
public function error( |
| ) |
Set an error header and exit.
error | The HTTP status code for the response. |
extra_message | An additional message to output for the response |