trait BaseController

Controller trait

Properties

protected string|null $extensionName Extension name
protected Container|null $container Container
protected string|null $pageName Page name
protected array $params Controller params

Methods

string|false
getRouteUrl(string|null $routeName, string|null $extension, array $params = [], string|null $language = null, bool $relative = false)

Get page url

string
getPageUrl(string $path = '', bool $relative = false, string|null $language = null)

Get page url

array
getParams()

Get params

mixed|null
getParam(string $key, mixed|null $default = null)

Get param

bool
resolveRouteParams(Request $request)

Resolve route params

string|null
getPageName()

Get page name

void
setExtensionName(string|null $name)

Set extension name

string|null
getExtensionName()

Get extension name

mixed
get(string $id)

Get item from container

bool
has(string $id)

Return tru if container item esist

Container
getContainer()

Get container

bool
logInfo(string $message, array $context = [])

Log message

array
getRequestParams(Request $request)

Get request params

mixed
getQueryParam(ServerRequestInterface $request, string $name, mixed $default = null)

Get query param

array
resolveRequestParams(Request $request, array $paramsKeys)

Resolve params

string
getUrl(ServerRequestInterface $request, bool $relative = false)

Get url

string|null
getError(string $errorCode, array $params = [])

Get error

bool
logError(string $message, array $context = [])

Log error

Details

at line 59
string|false getRouteUrl(string|null $routeName, string|null $extension, array $params = [], string|null $language = null, bool $relative = false)

Get page url

Parameters

string|null $routeName
string|null $extension
array $params
string|null $language
bool $relative

Return Value

string|false

at line 88
string getPageUrl(string $path = '', bool $relative = false, string|null $language = null)

Get page url

Parameters

string $path
bool $relative
string|null $language

Return Value

string

at line 98
array getParams()

Get params

Return Value

array

at line 110
mixed|null getParam(string $key, mixed|null $default = null)

Get param

Parameters

string $key
mixed|null $default

Return Value

mixed|null

at line 121
protected bool resolveRouteParams(Request $request)

Resolve route params

Parameters

Request $request

Return Value

bool

at line 146
string|null getPageName()

Get page name

Return Value

string|null

at line 157
void setExtensionName(string|null $name)

Set extension name

Parameters

string|null $name

Return Value

void

at line 167
string|null getExtensionName()

Get extension name

Return Value

string|null

at line 178
mixed get(string $id)

Get item from container

Parameters

string $id

Return Value

mixed

at line 194
bool has(string $id)

Return tru if container item esist

Parameters

string $id

Return Value

bool

at line 204
Container getContainer()

Get container

Return Value

Container

at line 216
bool logInfo(string $message, array $context = [])

Log message

Parameters

string $message
array $context

Return Value

bool

at line 227
array getRequestParams(Request $request)

Get request params

Parameters

Request $request

Return Value

array

at line 244
mixed getQueryParam(ServerRequestInterface $request, string $name, mixed $default = null)

Get query param

Parameters

ServerRequestInterface $request
string $name
mixed $default

Return Value

mixed

at line 258
array resolveRequestParams(Request $request, array $paramsKeys)

Resolve params

Parameters

Request $request
array $paramsKeys

Return Value

array

at line 275
string getUrl(ServerRequestInterface $request, bool $relative = false)

Get url

Parameters

ServerRequestInterface $request
bool $relative

Return Value

string

at line 289
string|null getError(string $errorCode, array $params = [])

Get error

Parameters

string $errorCode
array $params

Return Value

string|null

at line 303
bool logError(string $message, array $context = [])

Log error

Parameters

string $message
array $context

Return Value

bool