View Interface Reference
Detailed Description
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
-
$name The variable name $value The value
Implemented in SmartyView, and NullView.
◆ getValue()
| getValue | ( | $name | ) |
Get a value from the view.
- Parameters
-
$name The variable name
- Returns
- Mixed
Implemented in SmartyView, and NullView.
◆ getValues()
| getValues | ( | ) |
◆ 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
-
$tplFile The template file $cacheId The id of the view (optional,
- See also
- Response::getCacheId()) (optional: default: null)
- Parameters
-
$cacheLifetime The cache lifetime in seconds (optional, default: implementation specific) $display Boolean whether to output the result or return it (default: true)
Implemented in SmartyView, and NullView.
◆ clearCache()
|
static |
Clear the cache.
- Parameters
-
$tplFile The template file (optional, default: null), null to clear the complete cache $cacheId The 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 |
Check if a view is cached.
- Parameters
-
$tplFile The template file $cacheId The id of the view (
- See also
- Controller::getCacheId()) (optional: default: null)
Implemented in SmartyView, and NullView.
◆ getCacheDate()
|
static |
Get the date of the cache entry, if the view is cached.
- Parameters
-
$tplFile The template file $cacheId The 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 |
Get the template filename for the view from the configfile for the given action key.
- Parameters
-
$controller The name of the controller $context The name of the context $action The name of the action
- Returns
- The filename of the template or false, if no view is defined
Implemented in SmartyView, and NullView.