Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Docs For Class PageUtil

Class: PageUtil

Source Location: /pnobjlib/PageUtil.class.php

Class Overview


Zikula page variables functions

Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 49] Zikula page variables functions

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:

author:  Jörg Napp, Frank Schummertz
link:  http://www.pn-cms.de Zikula home page
[ Top ]

Class Methods


method addVar [line 227]

boolean addVar( string $varname, mixed $value)

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:

return:  true on success, false of the page variable is not registered.
author:  Jörg Napp
see:  PageUtil::setVar()
since:  Feb 04


Parameters:

string   $varname   the name of the page variable
mixed   $value   the new value

[ Top ]

method getVar [line 156]

mixed getVar( string $varname, [ $default = null])

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:

return:  the contents of the variable
author:  Jörg Napp
see:  PageUtil::setVar()
see:  PageUtil::addVar()
since:  Feb 04


Parameters:

string   $varname   the name of the page variable
   $default  

[ Top ]

method registerVar [line 73]

boolean registerVar( string $varname, [boolean $multivalue = false], [string $default = null])

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:

return:  success or not
author:  Jörg Napp
see:  PageUtil::resetVar()
since:  Feb 04


Parameters:

string   $varname   the name of the new page variable
boolean   $multivalue   to define a single or a multi valued variable
string   $default   to set the default value. This value is assigned to the variable at registration time.

[ Top ]

method resetVar [line 111]

boolean resetVar( string $varname)

resetVar()

Resets the pge variable back to its default value. All values assigned by addVar() or setVar() will get lost.




Tags:

return:  true on success, false of the page variable is not registered.
author:  Jörg Napp
see:  PageUtil::registerVar()
since:  Feb 04


Parameters:

string   $varname   the name of the page variable

[ Top ]

method setVar [line 191]

boolean setVar( string $varname, mixed $value)

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.




Tags:

return:  true on success, false of the page variable is not registered.
author:  Jörg Napp
see:  PageUtil::addVar()
since:  Feb 04


Parameters:

string   $varname   the name of the page variable
mixed   $value   the new value

[ Top ]

Packages:

Files:

Classes: