final class MicroPresenter implements IPresenter

Micro presenter.

Methods

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

No description

Container|null
getContext()

Gets the context.

run(Request $request)

No description

createTemplate(string|null $class = null, callable|null $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_NotFound)

Throws HTTP error.

Request|null
getRequest()

No description

Details

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

No description

Parameters

Container|null $context
IRequest|null $httpRequest
Router|null $router

at line 39
Container|null getContext()

Gets the context.

Return Value

Container|null

at line 45
Response run(Request $request)

No description

Parameters

Request $request

Return Value

Response

at line 113
Template createTemplate(string|null $class = null, callable|null $latteFactory = null)

Template factory.

Parameters

string|null $class
callable|null $latteFactory

Return Value

Template

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

Redirects to another URL.

Parameters

string $url
int $httpCode

Return Value

RedirectResponse

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

Throws HTTP error.

Parameters

string $message
int $httpCode

Return Value

void

Exceptions

BadRequestException

at line 154
Request|null getRequest()

No description

Return Value

Request|null