Public Member Functions | |
| __construct () | |
| Create a new AnewtPage instance. | |
Stylesheet methods | |
These methods allow you to add stylesheets to the page. | |
| add_stylesheet ($node) | |
| Add a stylesheet node to the page. | |
| add_stylesheet_href ($href) | |
| Add an external stylesheet reference to the page. | |
| add_stylesheet_href_media ($href, $media) | |
| Add an external stylesheet reference to the page. | |
JavaScript methods | |
These methods allow you to add JavaScript to the page. | |
| add_javascript ($node) | |
| Add JavaScript to this page. | |
| add_javascript_src ($src) | |
| Add a JavaScript reference to this page for the given source file. | |
| add_javascript_content ($content) | |
| Add a JavaScript to this page for the given content. | |
Linking methods | |
These methods should be used to link other resources to this page. | |
| add_link ($node) | |
| Add a link element to this page. | |
| add_link_rss ($href, $title) | |
| Add a link to a RSS feed to this page. | |
Private Attributes | |
| $_content | |
| Page content. | |
| $_blocks = array() | |
| Associative array of blocks. | |
| $_links = array() | |
| List of link nodes. | |
| $_javascripts = array() | |
| List of JavaScript nodes. | |
Content methods | |
| These methods should be used to add content to the page. | |
| append ($new_child) | |
| Append new content to this page. | |
| append_to ($name, $new_child) | |
| Append new content to a block on this page. | |
| get_block ($name) | |
| Get the contents of a block. | |
Output methods | |
| render () | |
| Render this page into XHTML. | |
| flush () | |
| Flush this page to the browser. | |
| build_content_type_charset () | |
| Build a content type and character set string. | |
Definition at line 17 of file page.lib.php.
| AnewtPage::add_stylesheet | ( | $ | node | ) |
Add a stylesheet node to the page.
This function accepts either a AnewtXHTMLStyle or an AnewtXHTMLLink element, e.g. created by ax_stylesheet() or ax_stylesheet_href(). Usually you should use add_stylesheet_href() or add_stylesheet_href_media() instead.
| $node | A AnewtXHTMLStyle or AnewtXHTMLLink (referring to a stylesheet) node. |
Definition at line 97 of file page.lib.php.
| AnewtPage::add_stylesheet_href | ( | $ | href | ) |
Add an external stylesheet reference to the page.
| $href | The location of the external stylesheet |
Definition at line 113 of file page.lib.php.
| AnewtPage::add_stylesheet_href_media | ( | $ | href, | |
| $ | media | |||
| ) |
Add an external stylesheet reference to the page.
| $href | The location of the external stylesheet | |
| $media | The media type for which this stylesheet is intended, e.g. print or screen. |
Definition at line 132 of file page.lib.php.
| AnewtPage::add_javascript | ( | $ | node | ) |
Add JavaScript to this page.
This function accepts a AnewtXHTMLScript node, e.g. one created using ax_javascript(). Use the add_javascript_src() and add_javascript_content() methods to easily add stylesheets to the page without creating the node yourself.
| $node | A AnewtXHTMLScript node. |
Definition at line 160 of file page.lib.php.
| AnewtPage::add_javascript_src | ( | $ | src | ) |
Add a JavaScript reference to this page for the given source file.
| $src | Source of the JavaScript file |
Definition at line 172 of file page.lib.php.
| AnewtPage::add_javascript_content | ( | $ | content | ) |
Add a JavaScript to this page for the given content.
| $content | Scripts contents. |
Definition at line 183 of file page.lib.php.
| AnewtPage::add_link | ( | $ | node | ) |
Add a link element to this page.
| $node | A AnewtXHTMLLink node. |
Definition at line 207 of file page.lib.php.
| AnewtPage::add_link_rss | ( | $ | href, | |
| $ | title | |||
| ) |
Add a link to a RSS feed to this page.
| $href | The location of the RSS feed | |
| $title | The title used to refer to the RSS feed |
Definition at line 225 of file page.lib.php.
| AnewtPage::append | ( | $ | new_child | ) |
Append new content to this page.
For simple pages this method just adds some content to the page. For block-based pages, this method adds content to the default block.
| $new_child | The content to add. This is most likely an Anewt XHTML element instance, e.g. created by the ax_* functions from the XHTML module. Numerical arrays are also accepted. |
Definition at line 252 of file page.lib.php.
| AnewtPage::append_to | ( | $ | name, | |
| $ | new_child | |||
| ) |
Append new content to a block on this page.
This method can only be used for block-based pages.
Note that the specified block is not required to be specified in the blocks property, though in most cases it will be (if you want it to be rendered at least). In some custom situations where you build blocks by other means, i.e. using build_* methods on your page subclass, it might be helpful to use custom block names to act as temporary containers for the page content. The build_* methods can then retrieve the value and do something smart with it.
| $name | The name of the block to which the content should be added. | |
| $new_child | The content to add. This is most likely an Anewt XHTML element instance, e.g. created by the ax_* functions from the XHTML module. Numerical arrays are also accepted. |
Definition at line 302 of file page.lib.php.
| AnewtPage::get_block | ( | $ | name | ) | [protected] |
Get the contents of a block.
This method returns the content of the block as an AnewtXMLDomNode instance, or null if no content was set for the requested block.
| $name | The name of the block to retrieve. |
Definition at line 329 of file page.lib.php.
| AnewtPage::render | ( | ) |
Render this page into XHTML.
This methods renders the whole page into a complete XHTML page. Usually you want to use flush() to output the page to the browser.
Definition at line 369 of file page.lib.php.
| AnewtPage::flush | ( | ) |
Flush this page to the browser.
This method renders the page into a XHTML string and outputs it to the browser along with the correct HTTP headers.
Definition at line 552 of file page.lib.php.
1.5.9