Class: PageUtil
Source Location: /pnobjlib/PageUtil.class.php
Class OverviewZikula page variables functions Author(s): |
Methods |
Inherited Variables
Inherited Methods
Class Details
A <em>page variable</em> is an entity identified by a name that stores a value for the currently rendered page. They are used to set for example the title of the page, the stylesheets used etc. from the module.
Page variables can be <em>single valued</em> or <em>multi valued</em>. In the first case, only one single value can be set; each new setting will overwrite the old one. The title is an example for a single values page variable (each page can have exactly one title). Multi valued variables can contain more than one value, and new values can be added to the variable. An example of a multi valued variable is stylesheet (a page can use more than one style sheet).
Zikula offers a set of API functions to manipulate page variables.
A module can register a new page variable by providing its metadata using the pnPageRegisterVar function.
Zikula doesn't impose any restriction on the page variabl's name except for duplicate and reserved names. As of this writing, the list of reserved names consists of
- title
- description
- keywords
- stylesheet
- javascript
- body
- rawtext
- footer
Tags:
Class Methods
method addVar [line 227]
|
addVar()
Adds a new vaule to a page variable. In the case of a single page variable, this functions acts exactly like PageUtil::setVar.
Tags:
Parameters:
method getVar [line 156]
|
getVar()
returns the value(s) of a page variable. In the case of a mulit valued variable, this is an array containing all assigned values
Tags:
Parameters:
method registerVar [line 73]
|
registerVar()
Registers a new page variable. Zikula doesn't impose any restriction on the page variabl's name except for duplicate and reserved names. As of this writing, the list of reserved names consists of
- title
- keywords
- stylesheet
- javascript
- body
Tags:
Parameters:
method resetVar [line 111]
|
resetVar()
Resets the pge variable back to its default value. All values assigned by addVar() or setVar() will get lost.
Tags:
Parameters:
method setVar [line 191]
|
setVar()
Sets the page variable to a new value. In the case of a multi valued page variable, all previously added values will get lost. If you want to add a value to a multi valued page variable, use PageUtil::addVar.
