lithium\template\View::__construct()
Overrides
lithium\core\Object::__construct()
Constructor.
Parameters
-
array
$config
Class configuration parameters The available options are:
'loader'
mixed: Instance or name of the class used for locating and reading template content. Defaults toFile
, which reads template content from PHP files.'renderer'
mixed: Instance or name of the class that populates template content with the data passed in to the view layer, typically from a controller. Defaults to'File'
, which executes templates as standard PHP files, using path information returned from theloader
class. Bothloader
andrenderer
classes are looked up using the'adapter.template.view'
path, which locates classes in theextensions\adapter\template\view
sub-namespace of an application or plugin.'request'
: TheRequest
object to be made available in the templates. Defaults tonull
.'steps'
array: The array of step configurations to add to the built-in configurations. Will be merged with the defaults, with any configurations passed in overwriting built-in steps. See the$_steps
property for more information.'processes'
array: The array of process steps to add to the built-in configurations. Will be merged with the defaults, with any configurations passed in overwriting built-in processes. See the$_processes
property for more information.'outputFilters'
array: An array of filters to be used when handling output. By default, the class is initialized with one filter,h
, which is used in automatic output escaping.
Returns
voidSource
public function __construct(array $config = []) {
$defaults = [
'request' => null,
'response' => null,
'loader' => 'File',
'renderer' => 'File',
'steps' => [],
'processes' => [],
'outputFilters' => []
];
parent::__construct($config + $defaults);
}