Jinya CMS

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

public mixed DEVICE_CODE_COOKIE = 'JinyaDeviceCode'
Tags

Properties

Methods

entityNotFound()

public entityNotFound(string $message) : ResponseInterface
Parameters
$message : string
Tags
throws
JsonException
Return values
ResponseInterface

formatIteratorPlain()

public formatIteratorPlain(Iterator<string|int, T$iterator) : array<string|int, array<string, mixed>>
Parameters
$iterator : Iterator<string|int, T>
Tags
template

T

throws
JsonException
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
throws
Throwable
Return values
ResponseInterface
public getLinks() : ResponseInterface
Tags
throws
Throwable
throws
JsonException
Return values
ResponseInterface

jsonIterator()

public jsonIterator(Iterator $iterator) : ResponseInterface
Parameters
$iterator : Iterator
Tags
throws
JsonException
Return values
ResponseInterface

jsonIteratorPlain()

public jsonIteratorPlain(Iterator $iterator) : ResponseInterface
Parameters
$iterator : Iterator
Tags
throws
JsonException
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
throws
Throwable
throws
Exception
Return values
ResponseInterface

renderBlogPost()

Displays the given blog post or returns a 404 page

public renderBlogPost(BlogPost $blogPost) : ResponseInterface|null
Parameters
$blogPost : BlogPost
Tags
throws
Throwable
Return values
ResponseInterface|null

checkForApiRequest()

private checkForApiRequest() : bool
Tags
throws
Exception
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
throws
Throwable
Return values
ResponseInterface

renderMenuItem()

private renderMenuItem(MenuItem $menuItem) : ResponseInterface
Parameters
$menuItem : MenuItem
Tags
throws
Throwable
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
throws
Throwable
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
Tags
throws
Throwable
Return values
ResponseInterface

Search results