Documentation

Nav
in package

Nav class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.3.0

Table of Contents

$acl  : Acl
Acl object
$aclStrict  : bool
Acl strict flag
$baseUrl  : string
Base URL
$childLevel  : int
Nav child level
$config  : array<string|int, mixed>
Nav config
$indent  : string
Indentation
$nav  : Child
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
__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
Get the Acl object
getBaseUrl()  : string
Get the base URL
getChildLevel()  : int
Get child level
getConfig()  : array<string|int, mixed>
Get the config
getIndent()  : string
Get the indent
getNav()  : Child
Get the nav object
getParentLevel()  : int
Get parent level
getRole()  : AclRole
Get a AclRole object
getRoles()  : array<string|int, mixed>
Get the AclRole objects
getTree()  : array<string|int, mixed>
Get the nav tree
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 $acl = null

$aclStrict

Acl strict flag

protected bool $aclStrict = false

$baseUrl

Base URL

protected string $baseUrl = null

$childLevel

Nav child level

protected int $childLevel = 1

$config

Nav config

protected array<string|int, mixed> $config = []

$indent

Indentation

protected string $indent = null

$nav

Parent nav element

protected Child $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> $tree = null ][, array<string|int, mixed> $config = null ]) : mixed

Instantiate the nav object

Parameters
$tree : array<string|int, mixed> = null
$config : array<string|int, mixed> = null
Return values
mixed

__toString()

Render Nav object to string

public __toString() : string
Return values
string

addBranch()

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
Nav

addLeaf()

Add to a leaf to nav tree branch

public addLeaf(string $branch, array<string|int, mixed> $leaf[, int $pos = null ][, bool $prepend = false ]) : Nav
Parameters
$branch : string
$leaf : array<string|int, mixed>
$pos : int = null
$prepend : bool = false
Return values
Nav

addRole()

Add a AclRole object

public addRole([AclRole $role = null ]) : Nav
Parameters
$role : AclRole = null
Return values
Nav

addRoles()

Add AclRole objects

public addRoles(array<string|int, mixed> $roles) : Nav
Parameters
$roles : array<string|int, mixed>
Return values
Nav

build()

Build the nav object

public build() : Nav
Return values
Nav

decrementChildLevel()

Decrement child level

public decrementChildLevel() : Nav
Return values
Nav

decrementParentLevel()

Decrement parent level

public decrementParentLevel() : Nav
Return values
Nav

getAcl()

Get the Acl object

public getAcl() : Acl
Return values
Acl

getBaseUrl()

Get the base URL

public getBaseUrl() : string
Return values
string

getChildLevel()

Get child level

public getChildLevel() : int
Return values
int

getConfig()

Get the config

public getConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIndent()

Get the indent

public getIndent() : string
Return values
string

getNav()

Get the nav object

public getNav() : Child
Return values
Child

getParentLevel()

Get parent level

public getParentLevel() : int
Return values
int

getRole()

Get a AclRole object

public getRole(string $name) : AclRole
Parameters
$name : string
Return values
AclRole

getRoles()

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>

hasRole()

Determine if there is a certain role

public hasRole(string $name) : bool
Parameters
$name : string
Return values
bool

hasRoles()

Determine if there are roles

public hasRoles() : bool
Return values
bool

incrementChildLevel()

Increment child level

public incrementChildLevel() : Nav
Return values
Nav

incrementParentLevel()

Increment parent level

public incrementParentLevel() : Nav
Return values
Nav

isAclStrict()

Determine if the Acl object is set as strict evaluation

public isAclStrict() : bool
Return values
bool

isReturnFalse()

Set the return false flag

public isReturnFalse() : bool
Return values
bool

nav()

Get the nav object (alias)

public nav() : Child
Return values
Child

rebuild()

Re-build the nav object

public rebuild() : Nav
Return values
Nav

render()

Render the nav object

public render() : string
Return values
string

returnFalse()

Set the return false flag

public returnFalse(bool $return) : Nav
Parameters
$return : bool
Return values
Nav

setAcl()

Set the Acl object

public setAcl([Acl $acl = null ]) : Nav
Parameters
$acl : Acl = null
Return values
Nav

setAclStrict()

Set the Acl object as strict evaluation

public setAclStrict(bool $strict) : Nav
Parameters
$strict : bool
Return values
Nav

setBaseUrl()

Set the base URL

public setBaseUrl(string $baseUrl) : Nav
Parameters
$baseUrl : string
Return values
Nav

setChildLevel()

Set child level

public setChildLevel(int $level) : Nav
Parameters
$level : int
Return values
Nav

setConfig()

Set the nav tree

public setConfig([array<string|int, mixed> $config = null ]) : Nav
Parameters
$config : array<string|int, mixed> = null
Return values
Nav

setIndent()

Set the indent

public setIndent(string $indent) : Nav
Parameters
$indent : string
Return values
Nav

setParentLevel()

Set parent level

public setParentLevel(int $level) : Nav
Parameters
$level : int
Return values
Nav

setRole()

Set a AclRole object (alias method)

public setRole([AclRole $role = null ]) : Nav
Parameters
$role : AclRole = null
Return values
Nav

setTree()

Set the nav tree

public setTree([array<string|int, mixed> $tree = null ]) : Nav
Parameters
$tree : array<string|int, mixed> = null
Return values
Nav

traverseTree()

Traverse tree to insert new leaf

protected traverseTree(array<string|int, mixed> $tree, string $branch, array<string|int, mixed> $newLeaf[, int $pos = null ][, bool $prepend = false ], int $depth) : array<string|int, mixed>
Parameters
$tree : array<string|int, mixed>
$branch : string
$newLeaf : array<string|int, mixed>
$pos : int = null
$prepend : bool = false
$depth : int
Return values
array<string|int, mixed>

Search results