SPage Class Reference

Represents. More...

Inheritance diagram for SPage:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($targetType= '')
 Create a new page.
 appendMetaSlotToPage ($ms)
 Append the value of a meta-slot to the page buffer.
 appendSlotToMetaSlot ($slot, $meta)
 Append the value of a slot to a meta-slot.
 appendToMetaSlot ($index, $input)
 Append content to the end of a meta-slot.
 appendToPage ($input)
 Append the $input variable to the buffer of the whole page.
 appendToSlot ($index, $input)
 Append content to the end of a slot.
 frontAppendSlotToMetaSlot ($slot, $meta)
 Prepend the value of a slot to the front of a meta-slot.
 frontAppendToPage ($input)
 Prepend the $input variable to the (beginning of the) buffer of the whole page.
 getFormat ()
 Get the format for the output page.
 getMetaSlot ($index)
 Get the value of an existing meta-slot.
 getPage ()
 Get the content of the page buffer.
 getSlot ($index)
 Get the value of an existing slot.
 getTargetType ()
 Get the target type for the output page (or the default type if none is set).
 setMetaSlot ($index, $input)
 Set the value of a meta-slot.
 setMetaSlotToSlot ($meta, $slot)
 Set the value of a meta-slot to the value of a slot.
 setPage ($input)
 Set the page buffer to $input.
 setSlot ($index, $input)
 Set the value of a slot in the page.


Detailed Description

Represents.

It allows other scripts to buffer content into small chunks called slots, which in turn can be combined into larger chunks called meta-slots. This class simply provides the methods to set, get, and append to slots and meta-slots, and to append slots to meta-slots

There are three levels of buffers:

A SLOT should be used for storing information such as the title of the page, the main body of the page content, etc.

A META-SLOT should represent an entire section of the page -- for instance, a top bar that pulls together a logo slot, some navigation slots, etc.

The PAGE buffer buffers the entire content of the output page.

Author:
Jonathan Stuart-Moore <jwsm@shodor.org> (2006)
Date:
10/17/2006

Constructor & Destructor Documentation

SPage::__construct ( targetType = ''  ) 

Create a new page.

Create a new page object that will be used to buffer all the content that PR2 will render into a webpage (or other output document).

Parameters:
$targetType [string]: The type of the output document (typically 'html')


Member Function Documentation

SPage::appendMetaSlotToPage ( ms  ) 

Append the value of a meta-slot to the page buffer.

If you are building up the page buffer from a set of meta-slots, you can use this function to append the value of a meta-slot to the page buffer.

Parameters:
$ms [string]: The name of the meta-slot to append
Returns:
[mixed]: False if the meta-slot does not exist

SPage::appendSlotToMetaSlot ( slot,
meta 
)

Append the value of a slot to a meta-slot.

In case you are building up the value of a meta-slot from a number of slots, this function will let you add the value of one slot onto the end of a meta-slot buffer.

Parameters:
$slot [string]: The name of the slot to be appended to the meta-slot
$meta [string]: The name of the meta-slot

SPage::appendToMetaSlot ( index,
input 
)

Append content to the end of a meta-slot.

After a meta-slot has been rendered and buffered by PR2, you can add additional content to the end of a meta-slot using this function.

Parameters:
$index [string]: The name of the meta-slot
$input [string]: The input to be appended to the meta-slot

SPage::appendToPage ( input  ) 

Append the $input variable to the buffer of the whole page.

Parameters:
$input [string]: The content to append to the page buffer

SPage::appendToSlot ( index,
input 
)

Append content to the end of a slot.

Add the value $input to what is in a slot named $index.

Parameters:
$index [string]: The name of the slot
$input [string]: The content to append to the slot

SPage::frontAppendSlotToMetaSlot ( slot,
meta 
)

Prepend the value of a slot to the front of a meta-slot.

In case you are building up the value of a meta-slot from a number of slots, this function will let you add the value of one slot onto the beginning of a meta-slot buffer.

Parameters:
$slot [string]: The name of the slot to be prepended to the meta-slot
$meta [string]: The name of the meta-slot

SPage::frontAppendToPage ( input  ) 

Prepend the $input variable to the (beginning of the) buffer of the whole page.

Parameters:
$input [string]: The content to prepend to the page buffer

SPage::getFormat (  ) 

Get the format for the output page.

Returns:
[string]: The format of the output page

SPage::getMetaSlot ( index  ) 

Get the value of an existing meta-slot.

Parameters:
$index [string]: The name of the meta-slot
Returns:
[string]: The value of the meta-slot

SPage::getPage (  ) 

Get the content of the page buffer.

Return the buffered content for the entire page

Returns:
[string]: The content of the page buffer

SPage::getSlot ( index  ) 

Get the value of an existing slot.

Parameters:
$index [string]: The name of the slot
Returns:
[string]: The value stored in the slot

SPage::getTargetType (  ) 

Get the target type for the output page (or the default type if none is set).

Returns:
[string]: The target type/format of the output page

SPage::setMetaSlot ( index,
input 
)

Set the value of a meta-slot.

Set the value of a slot named $index to be $input. Meta-slots store large, related chunks of the final page. This meta-slot buffer in SPage is set during the rendering process after PR2 has rendered the meta-slot's final HTML by combining its child slots using a page layout/template.

Parameters:
$index [string]: The name of the meta-slot
$input [string]: The input to be stored in the meta-slot

SPage::setMetaSlotToSlot ( meta,
slot 
)

Set the value of a meta-slot to the value of a slot.

Parameters:
$meta [string]: The name of the meta-slot to be overwritten
$slot [string]: The name of the slot to be used as the value

SPage::setPage ( input  ) 

Set the page buffer to $input.

Set the variable buffering the whole page to the value of the $input variable.

Parameters:
$input [string]: The content to store in the page buffer

SPage::setSlot ( index,
input 
)

Set the value of a slot in the page.

Set the value of slot $index to be $input. A slot is the smallest classification for buffering content in your page. It should be used to store one particular piece of content used to make up the final page, for instance the title of the page, the main body of the content, etc.

Parameters:
$index [string]: The name of the slot
$input [string]: The content to store in the slot


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

Generated on Wed Nov 24 02:03:24 2010 for Common by  doxygen 1.5.6