Class MasterPage

Description

The MasterPage class.

This class can be used to create page templates that can be used by several pages, which can drastically reduce the amount of code.

Follow these steps to use master pages properly:

  1. Include Wigbi topmost in the PAGE, NOT the master page.
  2. In the PAGE, start and stop Wigbi within content areas that are NOT used by the master page.
  3. In the MASTER PAGE, start Wigbi within the HEAD tag.
  4. In the PAGE, define content areas with openContent and closeContent.
  5. In the MASTER PAGE, retrieve all or some of the content areas with getContent.
  6. In the PAGE, set variables with setVariable.
  7. In the MASTER PAGE, retrieve all or some of the variables with getVariable.
  8. In the PAGE, call MasterPage::build() to generate the final output.
  9. Remember to stop Wigbi in both the page and the master page!

Pages that use master pages must NOT add any content outside of any content regions. Doing so will cause the page to display the content BEFORE any other content, even before the <html> tag!

Located in /wigbi_source/php/system/MasterPage.php (line 54)


	
			
Method Summary
 static void build (string $templateFile)
 static void closeContent (string $areaName)
 static array contentAreas ()
 static void getContent (string $name)
 static void getVariable (string $name)
 static void openContent (string $areaName)
 static void setVariable (string $name, string $value)
 static array variables ()
Methods
static build (line 109)

Build the master page, using a certain template file.

  • access: public
static void build (string $templateFile)
  • string $templateFile: The relative path to the master page template file.
static closeContent (line 122)

Close a previously opened content area.

  • access: public
static void closeContent (string $areaName)
  • string $areaName: The name of the content area.
static contentAreas (line 76)

Get all the content areas that have been used so far.

  • return: All the content areas that have been opened and closed far.
  • access: public
static array contentAreas ()
static getContent (line 136)

Get the content of a certain content area.

  • access: public
static void getContent (string $name)
  • string $name: The name of the content area.
static getVariable (line 151)

Get the value of a certain variable.

  • access: public
static void getVariable (string $name)
  • string $name: The name of the variable.
static openContent (line 169)

Open a content area.

All content that is defined between this and the closeContent function will be available to the master template.

  • access: public
static void openContent (string $areaName)
  • string $areaName: The name of the content area.
static setVariable (line 185)

Set the value of a certain variable.

  • access: public
static void setVariable (string $name, string $value)
  • string $name: The name of the variable.
  • string $value: The variable value.
static variables (line 91)

Get all the variables that have been set so far.

  • return: The value of the variables property.
  • access: public
static array variables ()

Documentation generated on Sun, 27 Dec 2009 20:12:03 +0100 by phpDocumentor 1.4.1