lithium\template\View::__construct()

public method

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 to File, 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 the loader class. Both loader and renderer classes are looked up using the 'adapter.template.view' path, which locates classes in the extensions\adapter\template\view sub-namespace of an application or plugin.
    • 'request': The Request object to be made available in the templates. Defaults to null.
    • '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

void

Source

	public function __construct(array $config = []) {
		$defaults = [
			'request' => null,
			'response' => null,
			'loader' => 'File',
			'renderer' => 'File',
			'steps' => [],
			'processes' => [],
			'outputFilters' => []
		];
		parent::__construct($config + $defaults);
	}