Documentation

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

Methods

calcTokenId()

calculates JWT token id

public calcTokenId(int $uid, string $username) : string
Parameters
$uid : int
$username : string
Return values
string

checkPermission()

checks if current user has specified permission

public checkPermission(string $permission_name) : bool
Parameters
$permission_name : string
Tags
throws
BasicException
Return values
bool

getCurrentUser()

gets current user

public getCurrentUser([bool $reset = false ]) : AccountModel|null
Parameters
$reset : bool = false
Tags
throws
DependencyException
throws
NotFoundException
Return values
AccountModel|null

hasLoggedUser()

checks if user is logged in

public hasLoggedUser() : bool
Tags
throws
DependencyException
throws
NotFoundException
Return values
bool

isHomePage()

checks if current is homepage

public isHomePage() : bool
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
throws
PhpfastcacheSimpleCacheException
Return values
bool

tokenIsActive()

checks if token is still active

public tokenIsActive(Token $token) : bool
Parameters
$token : Token
Return values
bool

getTokenData()

gets token data

protected getTokenData() : mixed

        
On this page

Search results