class Doctrine_Pager_Layout (View source)

Doctrine_Pager_Layout

Methods

void
__construct(Doctrine_Pager $pager, Doctrine_Pager_Range $pagerRange, string $urlMask)

__construct

void
_setPager($pager)

_setPager

execute($params = array(), $hydrationMode = null)

execute

void
_setPagerRange($pagerRange)

_setPagerRange

string
getUrlMask()

getUrlMask

void
_setUrlMask($urlMask)

_setUrlMask

string
getTemplate()

getTemplate

void
setTemplate($template)

setTemplate

string
getSelectedTemplate()

getSelectedTemplate

void
setSelectedTemplate($selectedTemplate)

setSelectedTemplate

string
getSeparatorTemplate()

getSeparatorTemplate

void
setSeparatorTemplate($separatorTemplate)

setSeparatorTemplate

void
addMaskReplacement($oldMask, $newMask, $asValue = false)

addMaskReplacement

void
removeMaskReplacement($oldMask)

removeMaskReplacement

void
cleanMaskReplacements()

cleanMaskReplacements

void
display($options = array(), $return = false)

display

string
processPage(array $options = array())

processPage

__toString()

Simply calls display, and returns the output.

string
_parseTemplate(array $options = array())

_parseTemplate

string
_parseUrlTemplate($options = array())

_parseUrlTemplate

string
_parseReplacementsTemplate($options = array())

_parseUrl

string
_parseUrl($options = array())

_parseUrl

string
_parseMaskReplacements($str)

_parseMaskReplacements

Details

void __construct(Doctrine_Pager $pager, Doctrine_Pager_Range $pagerRange, string $urlMask)

__construct

Parameters

Doctrine_Pager $pager Doctrine_Pager object related to the pager layout
Doctrine_Pager_Range $pagerRange Doctrine_Pager_Range object related to the pager layout
string $urlMask URL to be assigned for each page

Return Value

void

Doctrine_Pager getPager()

getPager

Returns the Doctrine_Pager object related to the pager layout

Return Value

Doctrine_Pager Doctrine_Pager object related to the pager range

protected void _setPager($pager)

_setPager

Defines the Doctrine_Pager object related to the pager layout

Parameters

$pager Doctrine_Pager object related to the pager range

Return Value

void

Doctrine_Collection execute($params = array(), $hydrationMode = null)

execute

Handy method to execute the query without need to retrieve the Pager instance

Parameters

$params Optional parameters to Doctrine_Query::execute
$hydrationMode Hydration Mode of Doctrine_Query::execute returned ResultSet.

Return Value

Doctrine_Collection The root collection

Doctrine_Pager_Range getPagerRange()

getPagerRange

Returns the Doctrine_Pager_Range subclass object related to the pager layout

Return Value

Doctrine_Pager_Range Doctrine_Pager_Range subclass object related to the pager range

protected void _setPagerRange($pagerRange)

_setPagerRange

Defines the Doctrine_Pager_Range subclass object related to the pager layout

Parameters

$pagerRange Doctrine_Pager_Range subclass object related to the pager range

Return Value

void

string getUrlMask()

getUrlMask

Returns the URL to be assigned for each page

Return Value

string URL to be assigned for each page

protected void _setUrlMask($urlMask)

_setUrlMask

Defines the URL to be assigned for each page

Parameters

$urlMask URL to be assigned for each page

Return Value

void

string getTemplate()

getTemplate

Returns the Template to be applied for inactive pages

Return Value

string Template to be applied for inactive pages

void setTemplate($template)

setTemplate

Defines the Template to be applied for inactive pages (also active page if selected template not defined)

Parameters

$template Template to be applied for inactive pages

Return Value

void

string getSelectedTemplate()

getSelectedTemplate

Returns the Template to be applied for active page

Return Value

string Template to be applied for active page

void setSelectedTemplate($selectedTemplate)

setSelectedTemplate

Defines the Template to be applied for active page

Parameters

$selectedTemplate Template to be applied for active page

Return Value

void

string getSeparatorTemplate()

getSeparatorTemplate

Returns the Separator template, applied between each page

Return Value

string Separator template, applied between each page

void setSeparatorTemplate($separatorTemplate)

setSeparatorTemplate

Defines the Separator template, applied between each page

Parameters

$separatorTemplate Separator template, applied between each page

Return Value

void

void addMaskReplacement($oldMask, $newMask, $asValue = false)

addMaskReplacement

Defines a mask replacement. When parsing template, it converts replacement masks into new ones (or values), allowing to change masks behavior on the fly

Parameters

$oldMask Mask to be replaced
$newMask Mask or Value that will be defined after replacement
$asValue Optional value (default false) that if defined as true, changes the bahavior of replacement mask to replacement value

Return Value

void

void removeMaskReplacement($oldMask)

removeMaskReplacement

Remove a mask replacement

Parameters

$oldMask Replacement Mask to be removed

Return Value

void

void cleanMaskReplacements()

cleanMaskReplacements

Remove all mask replacements

Return Value

void

void display($options = array(), $return = false)

display

Displays the pager on screen based on templates and options defined

Parameters

$options Optional parameters to be applied in template and url mask
$return Optional parameter if you want to capture the output of this method call (Default value is false), instead of printing it

Return Value

void If you would like to capture the output of Doctrine_Pager_Layout::display(), use the $return parameter. If this parameter is set to TRUE, this method will return its output, instead of printing it (which it does by default)

string processPage(array $options = array())

processPage

Parses the template and returns the string of a processed page

Parameters

array $options Optional parameters to be applied in template and url mask

Return Value

string Processed template for the given page

__toString()

Simply calls display, and returns the output.

protected string _parseTemplate(array $options = array())

_parseTemplate

Parse the template of a given page and return the processed template

Parameters

array $options Optional parameters to be applied in template and url mask

Return Value

string

protected string _parseUrlTemplate($options = array())

_parseUrlTemplate

Parse the url mask to return the correct template depending of the options sent. Already process the mask replacements assigned.

Parameters

$options Optional parameters to be applied in template and url mask

Return Value

string

protected string _parseReplacementsTemplate($options = array())

_parseUrl

Parse the mask replacements of a given page

Parameters

$options Optional parameters to be applied in template and url mask

Return Value

string

protected string _parseUrl($options = array())

_parseUrl

Parse the url mask of a given page and return the processed url

Parameters

$options Optional parameters to be applied in template and url mask

Return Value

string

protected string _parseMaskReplacements($str)

_parseMaskReplacements

Parse the mask replacements, changing from to-be replaced mask with new masks/values

Parameters

$str String to have masks replaced

Return Value

string