Properties

$translators

$translators :array

Type

array—translators

$templateData

$templateData :array

Type

array—template data

$current_user_model

$current_user_model :\App\Site\Models\User

Type

\App\Site\Models\User—current user model

$locale

$locale :string

Type

string—locale

$regions

$regions :array

Type

array—page regions

$template

$template :\League\Plates\Template\Template

Type

\League\Plates\Template\Template—template object

$current_user

$current_user :array

Type

array—current user data

$request

$request :\Symfony\Component\HttpFoundation\Request

Type

\Symfony\Component\HttpFoundation\Request—request object

$response

$response :\Symfony\Component\HttpFoundation\Response

Type

\Symfony\Component\HttpFoundation\Response—response object

$container

$container :\Psr\Container\ContainerInterface

Type

\Psr\Container\ContainerInterface—container

$page_title

$page_title :string

Type

string—page title

Methods

getRouteGroup()

getRouteGroup(): string

gets route group

Returns

string

getTranslations()

getTranslations(): array

get current page translations urls

Throws

\Degami\Basics\Exceptions\BasicException

Returns

array

getCurrentLocale()

getCurrentLocale(): string

gets current page's locale

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string

__construct()

__construct(\Psr\Container\ContainerInterface  $container,\Symfony\Component\HttpFoundation\Request|null  $request)

{@inheritdocs}

Parameters

\Psr\Container\ContainerInterface $container
\Symfony\Component\HttpFoundation\Request|null $request

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

addTag()

addTag(string  $region,\Degami\Basics\Html\TagElement|array  $tag): self|false

adds a tag to page region

Parameters

string $region
\Degami\Basics\Html\TagElement|array $tag

Returns

self|false

renderPage()

renderPage(\App\Site\Routing\RouteInfo|null  $route_info = null,array  $route_data = array()): \Symfony\Component\HttpFoundation\Response|self

controller entrypoint

Parameters

\App\Site\Routing\RouteInfo|null $route_info
array $route_data

Throws

\App\Base\Exceptions\PermissionDeniedException

Returns

\Symfony\Component\HttpFoundation\Response|self

getRewrite()

getRewrite(boolean  $reset = false): \App\Site\Models\Rewrite|null

gets Rewrite object for current page

Parameters

boolean $reset

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Site\Models\Rewrite|null

showMenu()

showMenu(): boolean

show menu flag.

utility function, subclasses can override this method to disable menu load

Returns

boolean

showBlocks()

showBlocks(): boolean

show blocks flag.

utility function, subclasses can override this method to disable blocks load

Returns

boolean

process()

process(\App\Site\Routing\RouteInfo|null  $route_info = null,array  $route_data = array()): \Symfony\Component\HttpFoundation\Response|self

controller action

Parameters

\App\Site\Routing\RouteInfo|null $route_info
array $route_data

Returns

\Symfony\Component\HttpFoundation\Response|self

getTemplate()

getTemplate(): \League\Plates\Template\Template

get current template

Returns

\League\Plates\Template\Template

getInfo()

getInfo(): array

gets info about current page

Returns

array

addFlashMessage()

addFlashMessage(string  $type,string  $message): \App\Base\Abstracts\Controllers\BaseHtmlPage

adds a flash message for next response

Parameters

string $type
string $message

Returns

\App\Base\Abstracts\Controllers\BaseHtmlPage

dropFlashMessages()

dropFlashMessages(): self

removes all currently stored flash messages

Returns

self

getFlashMessages()

getFlashMessages(): array

gets currently stored flash messages

Returns

array

calcTokenId()

calcTokenId(integer  $uid,string  $username): string

calculates JWT token id

Parameters

integer $uid
string $username

Returns

string

tokenIsActive()

tokenIsActive(\Lcobucci\JWT\Token  $token): boolean

checks if token is still active

Parameters

\Lcobucci\JWT\Token $token

Returns

boolean

checkPermission()

checkPermission(string  $permission_name): boolean

checks if current user has specified permission

Parameters

string $permission_name

Returns

boolean

hasLoggedUser()

hasLoggedUser(): boolean

checks if user is logged in

Returns

boolean

isHomePage()

isHomePage(): boolean

checks if current is homepage

Throws

\Degami\Basics\Exceptions\BasicException
\Phpfastcache\Exceptions\PhpfastcacheSimpleCacheException

Returns

boolean

getRequest()

getRequest(): \Symfony\Component\HttpFoundation\Request

get request object

Returns

\Symfony\Component\HttpFoundation\Request

__toString()

__toString(): string

toString magic method

Returns

string —

the form html

getUrl()

getUrl(string  $route_name,array  $route_params = array()): string

gets url by route_name and params

Parameters

string $route_name
array $route_params

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string

getRouteName()

getRouteName(): string

gets current route name

Returns

string

getControllerUrl()

getControllerUrl(): string

gets current controller url

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string

getDestParam()

getDestParam(null  $destination_url = null): string

gets the destination param

Parameters

null $destination_url

Throws

\Degami\Basics\Exceptions\BasicException

Returns

string

canBeFPC()

canBeFPC(): boolean

specifies if this controller is eligible for full page cache

Returns

boolean

getTranslator()

getTranslator(string|null  $locale_code = null): \Fisharebest\Localization\Translator

gets translator

Parameters

string|null $locale_code

Returns

\Fisharebest\Localization\Translator

__call()

__call(string  $name,mixed  $arguments): mixed

{@inheritdocs}

Parameters

string $name
mixed $arguments

Throws

\App\Base\Exceptions\InvalidValueException

Returns

mixed

requestUrl()

requestUrl(string  $url,string  $method = 'GET',array  $options = array()): string|boolean

executes an http request

Parameters

string $url
string $method
array $options

Throws

\Exception
\GuzzleHttp\Exception\GuzzleException

Returns

string|boolean

getContainer()

getContainer(): \Psr\Container\ContainerInterface

gets container object

Returns

\Psr\Container\ContainerInterface

getApp()

getApp(): \App\App

gets app object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\App

getLog()

getLog(): \Monolog\Logger

gets log object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Monolog\Logger

getTemplates()

getTemplates(): \League\Plates\Engine

gets plates engine object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\League\Plates\Engine

getDb()

getDb(): \LessQL\Database

gets db object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\LessQL\Database

getPdo()

getPdo(): \PDO

gets PDO object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\PDO

getSchema()

getSchema(): \Degami\SqlSchema\Schema

gets schema object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Degami\SqlSchema\Schema

getEventManager()

getEventManager(): \Gplanchat\EventManager\SharedEventEmitter

gets events manager service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Gplanchat\EventManager\SharedEventEmitter

getRouting()

getRouting(): \App\Site\Routing\Web

gets routing service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Site\Routing\Web

getUtils()

getUtils(): \App\Base\Tools\Utils\Globals

gets global utils service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\Globals

getSiteData()

getSiteData(): \App\Base\Tools\Utils\SiteData

gets site data service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\SiteData

getAssets()

getAssets(): \App\Base\Tools\Assets\Manager

gets assets manager

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Assets\Manager

getGuzzle()

getGuzzle(): \GuzzleHttp\Client

gets guzzle service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\GuzzleHttp\Client

getImagine()

getImagine(): \Imagine\Gd\Imagine

gets imagine service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Imagine\Gd\Imagine

getMailer()

getMailer(): \App\Base\Tools\Utils\Mailer

gets mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\Mailer

getSesMailer()

getSesMailer(): \Aws\Ses\SesClient

gets SES mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Aws\Ses\SesClient

getSmtpMailer()

getSmtpMailer(): \Swift_Mailer

gets SMTP mailer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Swift_Mailer

getCache()

getCache(): \App\Base\Tools\Cache\Manager

get cache manager

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Cache\Manager

getHtmlRenderer()

getHtmlRenderer(): \App\Base\Tools\Utils\HtmlPartsRenderer

gets html renderer service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\App\Base\Tools\Utils\HtmlPartsRenderer

getIcons()

getIcons(): \Feather\Icons

gets icons service

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\Feather\Icons

getEnv()

getEnv(string  $variable,mixed  $default = null): mixed

gets env variable

Parameters

string $variable
mixed $default

Throws

\Degami\Basics\Exceptions\BasicException

Returns

mixed

getRouteVerbs()

getRouteVerbs(): array

returns valid route HTTP verbs

Returns

array

getPageTitle()

getPageTitle(): string

gets page title

Returns

string

getTemplateData()

getTemplateData(): array

{@inheritdocs}

Returns

array

setObject()

setObject(\App\Base\Abstracts\Models\BaseModel  $object): \App\Base\Traits\FrontendTrait

sets object to show

Parameters

\App\Base\Abstracts\Models\BaseModel $object

Returns

\App\Base\Traits\FrontendTrait

getObject()

getObject(): \App\Base\Abstracts\Models\BaseModel|null

gets object to show

Returns

\App\Base\Abstracts\Models\BaseModel|null

checkCredentials()

checkCredentials(): boolean

checks user credentials

Returns

boolean

getBaseTemplateData()

getBaseTemplateData(): array

prepares basic template data

Returns

array

getRegionTags()

getRegionTags(string  $region): string

get page region tags html

Parameters

string $region

Returns

string

prepareTemplate()

prepareTemplate(): \League\Plates\Template\Template

prepare template object

Throws

\Degami\Basics\Exceptions\BasicException

Returns

\League\Plates\Template\Template

beforeRender()

beforeRender(): \Symfony\Component\HttpFoundation\Response|self

before render hook

Throws

\App\Base\Exceptions\PermissionDeniedException
\Degami\Basics\Exceptions\BasicException

Returns

\Symfony\Component\HttpFoundation\Response|self

getTemplateName()

getTemplateName(): string

gets current page template name

Returns

string

getTokenHeader()

getTokenHeader(): string

gets Authorization token header

Returns

string

getToken()

getToken(): \Lcobucci\JWT\Token

gets Authorization token Object

Returns

\Lcobucci\JWT\Token

getTokenValidationData()

getTokenValidationData(  $token): \Lcobucci\JWT\ValidationData

gets token validation data

Parameters

$token

Returns

\Lcobucci\JWT\ValidationData

getTokenData()

getTokenData(): array|boolean

gets token data

Returns

array|boolean

getRouteData()

getRouteData(null  $varname = null): mixed|null

gets route data

Parameters

null $varname

Returns

mixed|null

getResponse()

getResponse(): \Symfony\Component\HttpFoundation\Response

get response object

Returns

\Symfony\Component\HttpFoundation\Response

doRedirect()

doRedirect(  $url,array  $additional_headers = array()): \Symfony\Component\HttpFoundation\RedirectResponse

returns a redirect object

Parameters

$url
array $additional_headers

Returns

\Symfony\Component\HttpFoundation\RedirectResponse

getService()

getService(string  $service_key): mixed

gets registered service

Parameters

string $service_key

Throws

\Degami\Basics\Exceptions\BasicException

Returns

mixed

getAccessPermission()

getAccessPermission(): string

gets access permission name

Returns

string