- 1 Usage
- 2 Constants
- 3 Protected Data
- 4 Public Functions
- 5 Protected Functions
The auPage class is part of the auLib package. It provides functions for common page layout operations. It should be extended to handle the layout specific to a given website.
This class is meant to be extended as it includes only an incredibly basic layout. Every page on a website should create a page object for itself and use it for common layout operations.
If not defined already when auPage is included, this will get set to
'Generic Layout Class' and get used as the name of the website.
True if the page has been started.
True if the page has ended.
Any error messages that occurred before the page started.
Any information messages that occurred before the page started.
Current indentation: should always be whitespace.
Creates a new generic page layout object. If using a pages database, this is where the page record is looked up. This doesn't actually do anything, though it possibly should in classes that extend this class.
Displays an error on the page. If the page hasn't been started yet, the error is saved and then displayed once the page starts.
- $message = Error message.
- $detail = Any details of the error. Default no details.
Displays a message on the page. If the page hasn't been started yet, the message is saved and then displayed once the page starts.
- $message = Informational message.
Determines whether the page has queued messages to show.
- @return = True if there are queued messages to show.
Writes out the part of the layout that comes before the page-specific content. Also writes any queued messages.
- $windowtitle = Title of the page to be displayed in the browser titlebar.
- $title = Title of the page, to be displayed on the page itself. Default is to use $windowvalue here too.
Writes out the part of the layout that comes after the page-specific content.
Sends a page not found header and then displays the 404 error page. Override this if your 404 page isn't /404.php.
Writes out a heading on the page.
- $heading = Text of the heading.
- $id = ID of the heading, to work as #$id in links. Default is none.
Writes out a sub-heading on the page.
- $heading = Text of the sub-heading.
- $id = ID of the sub-heading, to work as #$id in links. Default is none.
Classes that extend auPage might find these functions useful, but they are not generally available.
Finds the parent page that the current page belongs to. It takes into account both query string variables and directories.
- $url = URL of the current page.
- @return = URL of parent page.
Displays all queued messages (errors and then information) on the page, once the page has been started.
Writes out a link to the most specific favicon that can be found.
Writes out a link to the relevant style sheets.
Writes out a link to the relevant client-side scripts. This includes the general script and page- and/or directory-specific scripts found in the form /scripts/dir-subdir-page.js.
- $general = Name of script file to include on all pages, without path or extension. Optional; default is general.