FrontendPageTrait uses trait:short, trait:short
Frontend pages Trait
Table of Contents
Properties
- $current_user : array<string|int, mixed>|object|null
- $current_user_model : AccountModel|null
- $current_website : Website|null
- $locale : string|null
- $template_data : array<string|int, mixed>
Methods
- calcTokenId() : string
- calculates JWT token id
- checkPermission() : bool
- checks if current user has specified permission
- getApp() : App
- getCurrentLocale() : string|null
- {@inheritdoc}
- getCurrentUser() : AccountModel|null
- gets current user
- getCurrentWebsite() : Website
- returns current website
- getEnvironment() : Manager
- getObject() : BaseModel|null
- getRouteGroup() : string|null
- gets route group
- getTemplateData() : array<string|int, mixed>
- {@inheritdoc}
- getTokenData() : mixed
- gets token data
- getTranslations() : array<string|int, mixed>
- {@inheritdoc}
- getWebRouter() : Web
- hasLoggedUser() : bool
- checks if user is logged in
- isHomePage() : bool
- checks if current is homepage
- alterTemplateName() : string
- eventually alters template name
- check2FA() : bool
- checks if 2FA is passed
- checkCredentials() : bool
- checks user credentials
Properties
$current_user
protected
array<string|int, mixed>|object|null
$current_user
= null
current user data
$current_user_model
protected
AccountModel|null
$current_user_model
= null
current user model
$current_website
protected
Website|null
$current_website
= null
current website model
$locale
protected
string|null
$locale
= null
locale
$template_data
protected
array<string|int, mixed>
$template_data
= []
template data
Methods
calcTokenId()
calculates JWT token id
public
calcTokenId(int $uid, string $username) : string
Parameters
- $uid : int
- $username : string
Return values
stringcheckPermission()
checks if current user has specified permission
public
checkPermission(string $permission_name) : bool
Parameters
- $permission_name : string
Tags
Return values
boolgetApp()
public
getApp() : App
Return values
AppgetCurrentLocale()
{@inheritdoc}
public
getCurrentLocale() : string|null
Tags
Return values
string|nullgetCurrentUser()
gets current user
public
getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
- $reset : bool = false
Tags
Return values
AccountModel|nullgetCurrentWebsite()
returns current website
public
getCurrentWebsite() : Website
Return values
WebsitegetEnvironment()
public
getEnvironment() : Manager
Return values
ManagergetObject()
public
getObject() : BaseModel|null
Return values
BaseModel|nullgetRouteGroup()
gets route group
public
static getRouteGroup() : string|null
Return values
string|nullgetTemplateData()
{@inheritdoc}
public
getTemplateData() : array<string|int, mixed>
Return values
array<string|int, mixed>getTokenData()
gets token data
public
getTokenData() : mixed
getTranslations()
{@inheritdoc}
public
getTranslations() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getWebRouter()
public
getWebRouter() : Web
Return values
WebhasLoggedUser()
checks if user is logged in
public
hasLoggedUser() : bool
Tags
Return values
boolisHomePage()
checks if current is homepage
public
isHomePage() : bool
Tags
Return values
boolalterTemplateName()
eventually alters template name
protected
alterTemplateName(string $templateName) : string
Parameters
- $templateName : string
Tags
Return values
stringcheck2FA()
checks if 2FA is passed
protected
check2FA() : bool
Return values
boolcheckCredentials()
checks user credentials
protected
checkCredentials() : bool