trait ControllerHelperTrait

Controller helper trait.

Traits

Container aware trait.

Properties

protected Container $container Container. from ContainerAwareTrait
protected array $resolved Array of resolved objects and/or references to resolved objects. from ContainerAwareTrait
Application $app from ContainerAwareTrait
CacheManager $cache from ContainerAwareTrait
Input $input from ContainerAwareTrait
Output $output from ContainerAwareTrait
CommandBusInterface $bus from ContainerAwareTrait
Config $config from ContainerAwareTrait
ConnectionManager $database from ContainerAwareTrait
ErrorHandler $errorHandler from ContainerAwareTrait
Event $event from ContainerAwareTrait
FileSystem $fileSystem from ContainerAwareTrait
AuthorizerInterface $authorizer from ContainerAwareTrait
Gatekeeper $gatekeeper from ContainerAwareTrait
Request $request from ContainerAwareTrait
Response $response from ContainerAwareTrait
Routes $routes from ContainerAwareTrait
URLBuilder $urlBuilder from ContainerAwareTrait
I18n $i18n from ContainerAwareTrait
PaginationFactoryInterface $pagination from ContainerAwareTrait
ConnectionManager $redis from ContainerAwareTrait
CryptoManager $crypto from ContainerAwareTrait
Signer $signer from ContainerAwareTrait
Session $session from ContainerAwareTrait
Humanizer $humanizer from ContainerAwareTrait
ValidatorFactory $validator from ContainerAwareTrait
ViewFactory $view from ContainerAwareTrait
LoggerInterface $logger from ContainerAwareTrait

Methods

setContainer(Container $container)

Sets the container instance.

mixed
__get(string $key)

Resolves item from the container using overloading.

fileResponse(string $file)

Returns a file response container.

redirectResponse(string $location, array $routeParams = [], array $queryParams = [], string $separator = '&', mixed $language = true)

Returns a redirect response container.

streamResponse(Closure $stream, string|null $contentType = null, string|null $charset = null)

Returns a stream response container.

jsonResponse(mixed $data, int $options = 0, int|null $status = null, string|null $charset = null)

Returns a JSON response builder.

Details

in ContainerAwareTrait at line 68
setContainer(Container $container)

Sets the container instance.

Parameters

Container $container Container

in ContainerAwareTrait at line 79
mixed __get(string $key)

Resolves item from the container using overloading.

Parameters

string $key Key

Return Value

mixed

at line 32
protected File fileResponse(string $file)

Returns a file response container.

Parameters

string $file File path

Return Value

File

at line 47
protected Redirect redirectResponse(string $location, array $routeParams = [], array $queryParams = [], string $separator = '&', mixed $language = true)

Returns a redirect response container.

Parameters

string $location Location
array $routeParams Route parameters
array $queryParams Associative array used to build URL-encoded query string
string $separator Argument separator
mixed $language Request language

Return Value

Redirect

at line 65
protected Stream streamResponse(Closure $stream, string|null $contentType = null, string|null $charset = null)

Returns a stream response container.

Parameters

Closure $stream Stream
string|null $contentType Content type
string|null $charset Character set

Return Value

Stream

at line 79
protected JSON jsonResponse(mixed $data, int $options = 0, int|null $status = null, string|null $charset = null)

Returns a JSON response builder.

Parameters

mixed $data Data
int $options JSON encode coptions
int|null $status Status code
string|null $charset Character set

Return Value

JSON