PHP Class Nette\Application\Application

Author: David Grudl
Inheritance: extends Nette\Object
Show file Open project: nette/application Class Usage Examples

Public Properties

Property Type Description
$catchExceptions enable fault barrier?
$errorPresenter string
$maxLoop integer
$onError function (Application $sender, \Exception|\Throwable $e); Occurs when an unhandled exception occurs in the application
$onPresenter function (Application $sender, Presenter $presenter); Occurs when a presenter is created
$onRequest function (Application $sender, Request $request); Occurs when a new request is received
$onResponse function (Application $sender, IResponse $response); Occurs when a new response is ready for dispatch
$onShutdown function (Application $sender, \Exception|\Throwable $e = NULL); Occurs before the application shuts down
$onStartup function (Application $sender); Occurs before the application loads presenter

Public Methods

Method Description
__construct ( Nette\Application\IPresenterFactory $presenterFactory, Nette\Application\IRouter $router, Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse )
createInitialRequest ( ) : Nette\Application\Request
getPresenter ( ) : Nette\Application\IPresenter Returns current presenter.
getPresenterFactory ( ) : Nette\Application\IPresenterFactory Returns presenter factory.
getRequests ( ) : Nette\Application\Request[] Returns all processed requests.
getRouter ( ) : Nette\Application\IRouter Returns router.
processException ( $e ) : void
processRequest ( Nette\Application\Request $request ) : void
run ( ) : void Dispatch a HTTP request to a front controller.

Method Details

__construct() public method

public __construct ( Nette\Application\IPresenterFactory $presenterFactory, Nette\Application\IRouter $router, Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse )
$presenterFactory Nette\Application\IPresenterFactory
$router Nette\Application\IRouter
$httpRequest Nette\Http\IRequest
$httpResponse Nette\Http\IResponse

createInitialRequest() public method

public createInitialRequest ( ) : Nette\Application\Request
return Nette\Application\Request

getPresenter() public method

Returns current presenter.
public getPresenter ( ) : Nette\Application\IPresenter
return Nette\Application\IPresenter

getPresenterFactory() public method

Returns presenter factory.
public getPresenterFactory ( ) : Nette\Application\IPresenterFactory
return Nette\Application\IPresenterFactory

getRequests() public method

Returns all processed requests.
public getRequests ( ) : Nette\Application\Request[]
return Nette\Application\Request[]

getRouter() public method

Returns router.
public getRouter ( ) : Nette\Application\IRouter
return Nette\Application\IRouter

processException() public method

public processException ( $e ) : void
return void

processRequest() public method

public processRequest ( Nette\Application\Request $request ) : void
$request Nette\Application\Request
return void

run() public method

Dispatch a HTTP request to a front controller.
public run ( ) : void
return void

Property Details

$catchExceptions public property

enable fault barrier?
public $catchExceptions

$errorPresenter public property

public string $errorPresenter
return string

$maxLoop public static property

public static int $maxLoop
return integer

$onError public property

function (Application $sender, \Exception|\Throwable $e); Occurs when an unhandled exception occurs in the application
public $onError

$onPresenter public property

function (Application $sender, Presenter $presenter); Occurs when a presenter is created
public $onPresenter

$onRequest public property

function (Application $sender, Request $request); Occurs when a new request is received
public $onRequest

$onResponse public property

function (Application $sender, IResponse $response); Occurs when a new response is ready for dispatch
public $onResponse

$onShutdown public property

function (Application $sender, \Exception|\Throwable $e = NULL); Occurs before the application shuts down
public $onShutdown

$onStartup public property

function (Application $sender); Occurs before the application loads presenter
public $onStartup