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, $cacheLifetime=null, $display=true)
 

Static Public Member Functions

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

Member Function Documentation

◆ setValue()

setValue (   $name,
  $value 
)

Assign a value to the view.

Parameters
$nameThe variable name
$valueThe value

Implemented in SmartyView, and NullView.

◆ getValue()

getValue (   $name)

Get a value from the view.

Parameters
$nameThe variable name
Returns
Mixed

Implemented in SmartyView, and NullView.

◆ getValues()

getValues ( )

Get all values from the view.

Returns
Array

Implemented in SmartyView, and NullView.

◆ clearAllValues()

clearAllValues ( )

Clear all values in the view.

Implemented in SmartyView, and NullView.

◆ render()

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

Render the given template.

Parameters
$tplFileThe template file
$cacheIdThe id of the view (optional,
See also
Response::getCacheId()) (optional: default: null)
Parameters
$cacheLifetimeThe cache lifetime in seconds (optional, default: implementation specific)
$displayBoolean whether to output the result or return it (default: true)

Implemented in SmartyView, and NullView.

◆ clearCache()

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

Clear the cache.

Parameters
$tplFileThe template file (optional, default: null), null to clear the complete cache
$cacheIdThe id of the view (
See also
Controller::getCacheId()) (optional: default: null)
Returns
Integer number of cache files deleted

Implemented in SmartyView, and NullView.

◆ isCached()

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()) (optional: default: null)

Implemented in SmartyView, and NullView.

◆ getCacheDate()

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()) (optional: default: null)
Returns
DateTime or null, if not cached

Implemented in SmartyView, and NullView.

◆ getTemplate()

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.