FrontendController
extends BaseController
in package
Tags
Table of Contents
- DEVICE_CODE_COOKIE = 'JinyaDeviceCode'
- $body : array<string, mixed>
- $activeTheme : Theme
- $analyticsService : AnalyticsService
- $engine : Engine
- $logger : LoggerInterface
- __construct() : mixed
- entityNotFound() : ResponseInterface
- formatIteratorPlain() : array<string|int, array<string, mixed>>
- frontend() : ResponseInterface
- Renders the given frontend route or a matching blog post if there is no menu item with the given route
- getLinks() : ResponseInterface
- jsonIterator() : ResponseInterface
- jsonIteratorPlain() : ResponseInterface
- postForm() : ResponseInterface
- Executes the form post. If the form is not found the 404 page will be returned
- renderBlogPost() : ResponseInterface|null
- Displays the given blog post or returns a 404 page
- checkForApiRequest() : bool
- executeErrorHandled() : ResponseInterface
- Executes the front action. If an error occurs, either the homepage or a page with the error code will be returned. If all error handling fails, the emergency website will be shown
- renderMenuItem() : ResponseInterface
- renderThemed() : ResponseInterface
- Renders the given template with the given data
- sendApiJson() : ResponseInterface
- Sends the given data as json response
Constants
DEVICE_CODE_COOKIE
public
mixed
DEVICE_CODE_COOKIE
= 'JinyaDeviceCode'
Tags
Properties
$body
public
array<string, mixed>
$body
$activeTheme read-only
private
Theme
$activeTheme
Tags
$analyticsService read-only
private
AnalyticsService
$analyticsService
= new AnalyticsService()
Tags
$engine
private
Engine
$engine
Tags
$logger read-only
private
LoggerInterface
$logger
Tags
Methods
__construct()
public
__construct([AnalyticsService $analyticsService = new AnalyticsService() ]) : mixed
Parameters
- $analyticsService : AnalyticsService = new AnalyticsService()
Tags
Return values
mixed —entityNotFound()
public
entityNotFound(string $message) : ResponseInterface
Parameters
- $message : string
Tags
Return values
ResponseInterface —formatIteratorPlain()
public
formatIteratorPlain(Iterator<string|int, T> $iterator) : array<string|int, array<string, mixed>>
Parameters
- $iterator : Iterator<string|int, T>
Tags
Return values
array<string|int, array<string, mixed>> —frontend()
Renders the given frontend route or a matching blog post if there is no menu item with the given route
public
frontend([string $route = '' ]) : ResponseInterface
Parameters
- $route : string = ''
Tags
Return values
ResponseInterface —getLinks()
public
getLinks() : ResponseInterface
Tags
Return values
ResponseInterface —jsonIterator()
public
jsonIterator(Iterator $iterator) : ResponseInterface
Parameters
- $iterator : Iterator
Tags
Return values
ResponseInterface —jsonIteratorPlain()
public
jsonIteratorPlain(Iterator $iterator) : ResponseInterface
Parameters
- $iterator : Iterator
Tags
Return values
ResponseInterface —postForm()
Executes the form post. If the form is not found the 404 page will be returned
public
postForm(string $route) : ResponseInterface
Parameters
- $route : string
Tags
Return values
ResponseInterface —renderBlogPost()
Displays the given blog post or returns a 404 page
public
renderBlogPost(BlogPost $blogPost) : ResponseInterface|null
Parameters
- $blogPost : BlogPost
Tags
Return values
ResponseInterface|null —checkForApiRequest()
private
checkForApiRequest() : bool
Tags
Return values
bool —executeErrorHandled()
Executes the front action. If an error occurs, either the homepage or a page with the error code will be returned. If all error handling fails, the emergency website will be shown
private
executeErrorHandled(callable $handler[, callable $onError = null ]) : ResponseInterface
Parameters
- $handler : callable
- $onError : callable = null
Tags
Return values
ResponseInterface —renderMenuItem()
private
renderMenuItem(MenuItem $menuItem) : ResponseInterface
Parameters
- $menuItem : MenuItem
Tags
Return values
ResponseInterface —renderThemed()
Renders the given template with the given data
private
renderThemed(string $template, array<string|int, mixed> $data[, int $statusCode = self::HTTP_OK ]) : ResponseInterface
Parameters
- $template : string
- $data : array<string|int, mixed>
- $statusCode : int = self::HTTP_OK
Tags
Return values
ResponseInterface —sendApiJson()
Sends the given data as json response
private
sendApiJson(string $template, array<string|int, mixed> $data[, int $statusCode = self::HTTP_OK ]) : ResponseInterface
Parameters
- $template : string
- $data : array<string|int, mixed>
- $statusCode : int = self::HTTP_OK