PageTrait
Pages Trait
Table of Contents
Properties
- $current_user : array<string|int, mixed>|object|null
- $current_user_model : AccountModel|null
- $route_info : RouteInfo|null
Methods
- calcTokenId() : string
- calculates JWT token id
- checkPermission() : bool
- checks if current user has specified permission
- getCurrentUser() : AccountModel|null
- gets current user
- hasLoggedUser() : bool
- checks if user is logged in
- isHomePage() : bool
- checks if current is homepage
- tokenIsActive() : bool
- checks if token is still active
- getTokenData() : mixed
- gets token data
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
$route_info
protected
RouteInfo|null
$route_info
route info object
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
boolgetCurrentUser()
gets current user
public
getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
- $reset : bool = false
Tags
Return values
AccountModel|nullhasLoggedUser()
checks if user is logged in
public
hasLoggedUser() : bool
Tags
Return values
boolisHomePage()
checks if current is homepage
public
isHomePage() : bool
Tags
Return values
booltokenIsActive()
checks if token is still active
public
tokenIsActive(Token $token) : bool
Parameters
- $token : Token
Return values
boolgetTokenData()
gets token data
protected
getTokenData() : mixed