Nav
in package
Nav class
Tags
Table of Contents
Properties
- $acl : Acl|null
- Acl object
- $aclStrict : bool
- Acl strict flag
- $baseUrl : string|null
- Base URL
- $childLevel : int
- Nav child level
- $config : array<string|int, mixed>
- Nav config
- $indent : string|null
- Indentation
- $nav : Child|null
- Parent nav element
- $parentLevel : int
- Nav parent level
- $returnFalse : bool
- Return false flag
- $roles : array<string|int, mixed>
- AclRole role objects
- $tree : array<string|int, mixed>
- Nav tree
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Render Nav object to string
- addBranch() : Nav
- Add to a nav tree branch
- addLeaf() : Nav
- Add to a leaf to nav tree branch
- addRole() : Nav
- Add a AclRole object
- addRoles() : Nav
- Add AclRole objects
- build() : Nav
- Build the nav object
- decrementChildLevel() : Nav
- Decrement child level
- decrementParentLevel() : Nav
- Decrement parent level
- getAcl() : Acl|null
- Get the Acl object
- getBaseUrl() : string|null
- Get the base URL
- getChildLevel() : int
- Get child level
- getConfig() : array<string|int, mixed>
- Get the config
- getIndent() : string|null
- Get the indent
- getNav() : Child
- Get the nav object
- getParentLevel() : int
- Get parent level
- getRole() : AclRole|null
- Get a AclRole object
- getRoles() : array<string|int, mixed>
- Get the AclRole objects
- getTree() : array<string|int, mixed>
- Get the nav tree
- hasAcl() : bool
- Determine if there is an ACL object
- hasRole() : bool
- Determine if there is a certain role
- hasRoles() : bool
- Determine if there are roles
- incrementChildLevel() : Nav
- Increment child level
- incrementParentLevel() : Nav
- Increment parent level
- isAclStrict() : bool
- Determine if the Acl object is set as strict evaluation
- isReturnFalse() : bool
- Set the return false flag
- nav() : Child
- Get the nav object (alias)
- rebuild() : Nav
- Re-build the nav object
- render() : string
- Render the nav object
- returnFalse() : Nav
- Set the return false flag
- setAcl() : Nav
- Set the Acl object
- setAclStrict() : Nav
- Set the Acl object as strict evaluation
- setBaseUrl() : Nav
- Set the base URL
- setChildLevel() : Nav
- Set child level
- setConfig() : Nav
- Set the nav tree
- setIndent() : Nav
- Set the indent
- setParentLevel() : Nav
- Set parent level
- setRole() : Nav
- Set a AclRole object (alias method)
- setTree() : Nav
- Set the nav tree
- traverseTree() : array<string|int, mixed>
- Traverse tree to insert new leaf
Properties
$acl
Acl object
protected
Acl|null
$acl
= null
$aclStrict
Acl strict flag
protected
bool
$aclStrict
= false
$baseUrl
Base URL
protected
string|null
$baseUrl
= null
$childLevel
Nav child level
protected
int
$childLevel
= 1
$config
Nav config
protected
array<string|int, mixed>
$config
= []
$indent
Indentation
protected
string|null
$indent
= null
$nav
Parent nav element
protected
Child|null
$nav
= null
$parentLevel
Nav parent level
protected
int
$parentLevel
= 1
$returnFalse
Return false flag
protected
bool
$returnFalse
= false
$roles
AclRole role objects
protected
array<string|int, mixed>
$roles
= []
$tree
Nav tree
protected
array<string|int, mixed>
$tree
= []
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed>|null $tree = null ][, array<string|int, mixed>|null $config = null ]) : mixed
Instantiate the nav object
Parameters
- $tree : array<string|int, mixed>|null = null
- $config : array<string|int, mixed>|null = null
__toString()
Render Nav object to string
public
__toString() : string
Return values
stringaddBranch()
Add to a nav tree branch
public
addBranch(array<string|int, mixed> $branch[, bool $prepend = false ]) : Nav
Parameters
- $branch : array<string|int, mixed>
- $prepend : bool = false
Return values
NavaddLeaf()
Add to a leaf to nav tree branch
public
addLeaf(string $branch, array<string|int, mixed> $leaf[, int|null $pos = null ][, bool $prepend = false ]) : Nav
Parameters
- $branch : string
- $leaf : array<string|int, mixed>
- $pos : int|null = null
- $prepend : bool = false
Return values
NavaddRole()
Add a AclRole object
public
addRole([AclRole|null $role = null ]) : Nav
Parameters
- $role : AclRole|null = null
Return values
NavaddRoles()
Add AclRole objects
public
addRoles(array<string|int, mixed> $roles) : Nav
Parameters
- $roles : array<string|int, mixed>
Return values
Navbuild()
Build the nav object
public
build() : Nav
Return values
NavdecrementChildLevel()
Decrement child level
public
decrementChildLevel() : Nav
Return values
NavdecrementParentLevel()
Decrement parent level
public
decrementParentLevel() : Nav
Return values
NavgetAcl()
Get the Acl object
public
getAcl() : Acl|null
Return values
Acl|nullgetBaseUrl()
Get the base URL
public
getBaseUrl() : string|null
Return values
string|nullgetChildLevel()
Get child level
public
getChildLevel() : int
Return values
intgetConfig()
Get the config
public
getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getIndent()
Get the indent
public
getIndent() : string|null
Return values
string|nullgetNav()
Get the nav object
public
getNav() : Child
Return values
ChildgetParentLevel()
Get parent level
public
getParentLevel() : int
Return values
intgetRole()
Get a AclRole object
public
getRole(string $name) : AclRole|null
Parameters
- $name : string
Return values
AclRole|nullgetRoles()
Get the AclRole objects
public
getRoles() : array<string|int, mixed>
Return values
array<string|int, mixed>getTree()
Get the nav tree
public
getTree() : array<string|int, mixed>
Return values
array<string|int, mixed>hasAcl()
Determine if there is an ACL object
public
hasAcl() : bool
Return values
boolhasRole()
Determine if there is a certain role
public
hasRole(string $name) : bool
Parameters
- $name : string
Return values
boolhasRoles()
Determine if there are roles
public
hasRoles() : bool
Return values
boolincrementChildLevel()
Increment child level
public
incrementChildLevel() : Nav
Return values
NavincrementParentLevel()
Increment parent level
public
incrementParentLevel() : Nav
Return values
NavisAclStrict()
Determine if the Acl object is set as strict evaluation
public
isAclStrict() : bool
Return values
boolisReturnFalse()
Set the return false flag
public
isReturnFalse() : bool
Return values
boolnav()
Get the nav object (alias)
public
nav() : Child
Return values
Childrebuild()
Re-build the nav object
public
rebuild() : Nav
Return values
Navrender()
Render the nav object
public
render() : string
Return values
stringreturnFalse()
Set the return false flag
public
returnFalse(bool $return) : Nav
Parameters
- $return : bool
Return values
NavsetAcl()
Set the Acl object
public
setAcl([Acl|null $acl = null ]) : Nav
Parameters
- $acl : Acl|null = null
Return values
NavsetAclStrict()
Set the Acl object as strict evaluation
public
setAclStrict(bool $strict) : Nav
Parameters
- $strict : bool
Return values
NavsetBaseUrl()
Set the base URL
public
setBaseUrl(string $baseUrl) : Nav
Parameters
- $baseUrl : string
Return values
NavsetChildLevel()
Set child level
public
setChildLevel(int $level) : Nav
Parameters
- $level : int
Return values
NavsetConfig()
Set the nav tree
public
setConfig([array<string|int, mixed>|null $config = null ]) : Nav
Parameters
- $config : array<string|int, mixed>|null = null
Return values
NavsetIndent()
Set the indent
public
setIndent(string $indent) : Nav
Parameters
- $indent : string
Return values
NavsetParentLevel()
Set parent level
public
setParentLevel(int $level) : Nav
Parameters
- $level : int
Return values
NavsetRole()
Set a AclRole object (alias method)
public
setRole([AclRole|null $role = null ]) : Nav
Parameters
- $role : AclRole|null = null
Return values
NavsetTree()
Set the nav tree
public
setTree([array<string|int, mixed>|null $tree = null ]) : Nav
Parameters
- $tree : array<string|int, mixed>|null = null
Return values
NavtraverseTree()
Traverse tree to insert new leaf
protected
traverseTree(array<string|int, mixed> $tree, string $branch, array<string|int, mixed> $newLeaf[, int|null $pos = null ][, bool $prepend = false ][, int $depth = 0 ]) : array<string|int, mixed>
Parameters
- $tree : array<string|int, mixed>
- $branch : string
- $newLeaf : array<string|int, mixed>
- $pos : int|null = null
- $prepend : bool = false
- $depth : int = 0