Detailed Description

View defines the interface for all view implementations.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 18 of file View.php.

+ Inheritance diagram for View:

Public Member Functions

 setValue ($name, $value)
 
 getValue ($name)
 
 getValues ()
 
 clearAllValues ()
 
 render ($tplFile, $cacheId=null, $display=true)
 

Static Public Member Functions

static clearCache ()
 
static isCached ($tplFile, $cacheId=null)
 
static getCacheDate ($tplFile, $cacheId=null)
 
static getTemplate ($controller, $context, $action)
 

Member Function Documentation

setValue (   $name,
  $value 
)

Assign a value to the view.

Parameters
$nameThe variable name
$valueThe value

Implemented in SmartyView, and NullView.

getValue (   $name)

Get a value from the view.

Parameters
$nameThe variable name
Returns
Mixed

Implemented in SmartyView, and NullView.

getValues ( )

Get all values from the view.

Returns
Array

Implemented in SmartyView, and NullView.

clearAllValues ( )

Clear all values in the view.

Implemented in SmartyView, and NullView.

render (   $tplFile,
  $cacheId = null,
  $display = true 
)

Render the given template.

Parameters
$tplFileThe template file
$cacheIdThe id of the view (
See also
Controller::getCacheId())
Parameters
$displayBoolean whether to output the result or return it (default: true)

Implemented in SmartyView, and NullView.

static clearCache ( )
static

Clear the cache.

Returns
Integer number of cache files deleted

Implemented in SmartyView, and NullView.

static isCached (   $tplFile,
  $cacheId = null 
)
static

Check if a view is cached.

Parameters
$tplFileThe template file
$cacheIdThe id of the view (
See also
Controller::getCacheId())

Implemented in SmartyView, and NullView.

static getCacheDate (   $tplFile,
  $cacheId = null 
)
static

Get the date of the cache entry, if the view is cached.

Parameters
$tplFileThe template file
$cacheIdThe id of the view (
See also
Controller::getCacheId())
Returns
DateTime or null, if not cached

Implemented in SmartyView, and NullView.

static getTemplate (   $controller,
  $context,
  $action 
)
static

Get the template filename for the view from the configfile for the given action key.

Parameters
$controllerThe name of the controller
$contextThe name of the context
$actionThe name of the action
Returns
The filename of the template or false, if no view is defined

Implemented in SmartyView, and NullView.