class MicroPresenter implements IPresenter

Micro presenter.

Traits

Strict class for better experience.

Methods

__construct(Container $context = null, IRequest $httpRequest = null, Router $router = null)

No description

Container|null
getContext()

Gets the context.

run(Request $request)

No description

createTemplate(string $class = null, callable $latteFactory = null)

Template factory.

redirectUrl(string $url, int $httpCode = Http\IResponse::S302_FOUND)

Redirects to another URL.

void
error(string $message = '', int $httpCode = Http\IResponse::S404_NOT_FOUND)

Throws HTTP error.

Request|null
getRequest()

No description

Details

at line 40
__construct(Container $context = null, IRequest $httpRequest = null, Router $router = null)

Parameters

Container $context
IRequest $httpRequest
Router $router

at line 51
Container|null getContext()

Gets the context.

Return Value

Container|null

at line 57
IResponse run(Request $request)

Parameters

Request $request

Return Value

IResponse

at line 114
ITemplate createTemplate(string $class = null, callable $latteFactory = null)

Template factory.

Parameters

string $class
callable $latteFactory

Return Value

ITemplate

at line 134
RedirectResponse redirectUrl(string $url, int $httpCode = Http\IResponse::S302_FOUND)

Redirects to another URL.

Parameters

string $url
int $httpCode

Return Value

RedirectResponse

at line 144
void error(string $message = '', int $httpCode = Http\IResponse::S404_NOT_FOUND)

Throws HTTP error.

Parameters

string $message
int $httpCode

Return Value

void

Exceptions

BadRequestException

at line 150
Request|null getRequest()

Return Value

Request|null