Class jZone

Description

jZone is a representation of a zone in an response content, in a html page.

A user zone should inherits from jZone. jZone provide a cache mecanism.

Located in /utils/jZone.class.php (line 24)


	
			
Direct descendents
Class Description
check_installZone a zone to display a default start page with results of the installation check
Variable Summary
integer $_cacheTimeout
boolean $_cancelCache
array $_params
string $_tplname
boolean $_useCache
Method Summary
static void clear (string $name, [array $params = array ()])
static void clearAll ([string $name = ''])
static string get (string $name, [array $params = array ()])
jZone __construct ([ $params = array()])
void clearCache ()
string getContent ()
mixed getParam (string $paramName, [mixed $defaultValue = null])
mixed param (string $paramName, [mixed $defaultValue = null])
string _createContent ()
void _prepareTpl ()
void __get ( $name)
void __set ( $name,  $value)
Variables
integer $_cacheTimeout = 0 (line 37)

cache timeout (seconds).

set to 0 if you want to delete cache manually.

  • access: protected
boolean $_cancelCache = false (line 78)

When the cache system is activated, says if the cache should be generated or not you set it to false in _createContent or _prepareTpl, in specific case.

  • access: protected
array $_params (line 43)

list of zone parameters

  • access: protected
jTpl $_tpl = null (line 71)

the jtpl object created automatically by jZone if you set up _tplname

you can use it in _prepareTpl

  • access: protected
string $_tplname = '' (line 52)

template selector

If you want to use a template for your zone, set its name in this property in your zone, and override _prepareTpl. Else, keep it to empty string, and override _createContent

  • access: protected

Redefined in descendants as:
string $_tplOutputType = '' (line 64)

says the type of the output of the template, in the case of the result of the zone is not used in a response in the same output type.

For example, the output type of a ajax response is text, but the template can contains html, so the template should be treated as html content, so you should put 'html' here. If empty, the output type will be the output type of the current response.

  • see: jTpl::fetch
  • access: protected
boolean $_useCache = false (line 30)

If we're using cache on this zone

You should override it in your class if you want activate the cache

  • access: protected
Methods
static clear (line 104)

clear a specific cache of a zone

  • since: 1.0b1
  • access: public
static void clear (string $name, [array $params = array ()])
  • string $name: zone selector
  • array $params: parameters for the zone
static clearAll (line 113)

clear all zone cache or all cache of a specific zone

  • since: 1.0b1
  • access: public
static void clearAll ([string $name = ''])
  • string $name: zone selector
static get (line 94)

get the content of a zone

  • return: the generated content of the zone
  • since: 1.0b1
  • access: public
static string get (string $name, [array $params = array ()])
  • string $name: zone selector
  • array $params: parameters for the zone
Constructor __construct (line 83)

constructor.

jZone __construct ([ $params = array()])
  • $params
clearCache (line 201)

Delete the cache of the current zone

  • access: public
void clearCache ()
getContent (line 160)

get the zone content

Return the cache content if it is activated and if it's exists, or call _createContent

  • return: zone content
  • access: public
string getContent ()
getParam (line 151)

Same as param(), included for compatibility with older versions

  • return: the param value
  • deprecated: 1.1
  • access: public
mixed getParam (string $paramName, [mixed $defaultValue = null])
  • string $paramName: the parameter name
  • mixed $defaultValue: the parameter default value
param (line 140)

gets the value of a parameter, if defined. Returns the default value instead.

  • return: the param value
  • access: public
mixed param (string $paramName, [mixed $defaultValue = null])
  • string $paramName: the parameter name
  • mixed $defaultValue: the parameter default value
_createContent (line 218)

create the content of the zone by default, it uses a template, and so prepare a jtpl object to use in _prepareTpl.

zone parameters are automatically assigned in the template If you don't want a template, override it in your class

  • return: generated content
  • access: protected
string _createContent ()
_prepareTpl (line 231)

override this method if you want do additionnal thing on the template object

Example : do access to a dao object.. Note : the template object is in the _tpl property

  • access: protected
void _prepareTpl ()

Redefined in descendants as:
__get (line 282)
  • deprecated:
void __get ( $name)
  • $name
__set (line 272)
  • deprecated:
void __set ( $name,  $value)
  • $name
  • $value

Documentation generated on Thu, 19 Sep 2013 00:08:10 +0200 by phpDocumentor 1.4.3