HomeController
extends BaseController
in package
FinalYes
Table of Contents
Properties
Methods
- __construct() : mixed
- index() : ResponseInterface
- proposeAnnouncement() : ResponseInterface
- flash() : void
- getCurrentUserId() : int|null
- jsonResponse() : ResponseInterface
- JSON response helper
- noContentResponse() : ResponseInterface
- No content response helper
- redirect() : ResponseInterface
- Redirect to URL
- render() : ResponseInterface
- Render view and return as response
Properties
$flash read-only
public
FlashMessengerInterface
$flash
$renderer
public
ViewRendererInterface
$renderer
$requestContext
public
RequestContext
$requestContext
Methods
__construct()
public
__construct(RequestContext $requestContext, ViewRendererInterface $renderer, FlashMessengerInterface $flash) : mixed
Parameters
- $requestContext : RequestContext
- $renderer : ViewRendererInterface
- $flash : FlashMessengerInterface
index()
public
index() : ResponseInterface
Return values
ResponseInterfaceproposeAnnouncement()
public
proposeAnnouncement() : ResponseInterface
Return values
ResponseInterfaceflash()
protected
flash(string $key, string $message) : void
Parameters
- $key : string
- $message : string
getCurrentUserId()
protected
getCurrentUserId() : int|null
Tags
Return values
int|nulljsonResponse()
JSON response helper
protected
jsonResponse(int $statusCode, array<string|int, mixed> $data) : ResponseInterface
Parameters
- $statusCode : int
- $data : array<string|int, mixed>
Return values
ResponseInterfacenoContentResponse()
No content response helper
protected
noContentResponse([int $statusCode = 204 ]) : ResponseInterface
Parameters
- $statusCode : int = 204
Return values
ResponseInterfaceredirect()
Redirect to URL
protected
redirect(string $location[, int $statusCode = 302 ]) : ResponseInterface
Parameters
- $location : string
- $statusCode : int = 302
Return values
ResponseInterfacerender()
Render view and return as response
protected
render(string $view[, array<string|int, mixed> $data = [] ][, int $statusCode = 200 ]) : ResponseInterface
Parameters
- $view : string
- $data : array<string|int, mixed> = []
- $statusCode : int = 200