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
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
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.
Tags:
return:
true on success, false of the page variable is not registered.