lithium\template\View::_init()

protected method

Perform initialization of the View.

Looks up and initializes loader and renderer classes, and initializes the output escape handler, matching the encoding from the Response object.

Returns

void

Source

	protected function _init() {
		$encoding = 'UTF-8';

		if ($this->_response) {
			$encoding =& $this->_response->encoding;
		}
		$h = function($data) use (&$encoding) {
			return htmlspecialchars((string) $data, ENT_QUOTES, $encoding);
		};
		$this->outputFilters += compact('h') + $this->_config['outputFilters'];

		foreach (['loader', 'renderer'] as $key) {
			if (is_object($this->_config[$key])) {
				$this->{'_' . $key} = $this->_config[$key];
				continue;
			}
			$class = $this->_config[$key];
			$config = ['view' => $this] + $this->_config;
			$this->{'_' . $key} = Libraries::instance($this->_adapters, $class, $config);
		}
	}