lithium\action\Controller::_init()

protected method

Populates the $response property with a new instance of the Response class passing it configuration, and sets some rendering options, depending on the incoming request.

Returns

void

Source

	protected function _init() {
		parent::_init();

		$this->_inherit(['_render']);

		$this->request = $this->request ?: $this->_config['request'];
		$this->response = Libraries::instance(
			null, 'response', $this->_config['response'], $this->_classes
		);

		if (!$this->request || $this->_render['type']) {
			return;
		}
		if ($this->_render['negotiate']) {
			$this->_render['type'] = $this->request->accepts();
			return;
		}
		$this->_render['type'] = $this->request->get('params:type') ?: 'html';
	}