src/Http/Kernel.php
/**
	 * Dispatches the controller for the current request.
	 *
	 * @param Route $route
	 */
Dispatches the controller for the current request.
@param Route $route
Dispatches the controller for the current request . @param Route $route
private function executeController(Route $route) {
		if ($this->response->isHalted()) {
			return;
		}
		$result = $route->execute($this->request, $this->response);
		if ($this->response->getLength() === 0 && !is_null($result)) {
			$this->response->writeLine(json_encode(
				$result,
				JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE
			));
			if (!$this->response->getHeader('content-type')) {
				$this->response->setHeader('content-type', 'application/json');
			}
		}
	}
private function executeController ( Route $ route ) { if ( $ this -> response -> isHalted ( ) ) { return ; } $ result = $ route -> execute ( $ this -> request , $ this -> response ) ; if ( $ this -> response -> getLength ( ) === 0 && ! is_null ( $ result ) ) { $ this -> response -> writeLine ( json_encode ( $ result , JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) ) ; if ( ! $ this -> response -> getHeader ( 'content-type' ) ) { $ this -> response -> setHeader ( 'content-type' , 'application/json' ) ; } } }
Dispatches the controller for the current request.
Dispatches the controller for the current request .
// Execute the controller // Send the returned response if applicable