Properties

$tree

$tree : array

Nav tree

Type

array

$config

$config : array

Nav config

Type

array

$roles

$roles : array

AclRole role objects

Type

array

$aclStrict

$aclStrict : boolean

Acl strict flag

Type

boolean

$indent

$indent : string

Indentation

Type

string

$baseUrl

$baseUrl : string

Base URL

Type

string

$parentLevel

$parentLevel : integer

Nav parent level

Type

integer

$childLevel

$childLevel : integer

Nav child level

Type

integer

$returnFalse

$returnFalse : boolean

Return false flag

Type

boolean

Methods

__construct()

__construct(array  $tree = null, array  $config = null) : self

Constructor

Instantiate the nav object

Parameters

array $tree
array $config

Returns

self

returnFalse()

returnFalse(boolean  $return) : \Pop\Nav\Nav

Set the return false flag

Parameters

boolean $return

Returns

\Pop\Nav\Nav

setTree()

setTree(array  $tree = null) : \Pop\Nav\Nav

Set the nav tree

Parameters

array $tree

Returns

\Pop\Nav\Nav

addBranch()

addBranch(array  $branch, boolean  $prepend = false) : \Pop\Nav\Nav

Add to a nav tree branch

Parameters

array $branch
boolean $prepend

Returns

\Pop\Nav\Nav

addLeaf()

addLeaf(string  $branch, array  $leaf, integer  $pos = null, boolean  $prepend = false) : \Pop\Nav\Nav

Add to a leaf to nav tree branch

Parameters

string $branch
array $leaf
integer $pos
boolean $prepend

Returns

\Pop\Nav\Nav

setConfig()

setConfig(array  $config = null) : \Pop\Nav\Nav

Set the nav tree

Parameters

array $config

Returns

\Pop\Nav\Nav

setAcl()

setAcl(\Pop\Acl\Acl  $acl = null) : \Pop\Nav\Nav

Set the Acl object

Parameters

\Pop\Acl\Acl $acl

Returns

\Pop\Nav\Nav

setRole()

setRole(\Pop\Acl\AclRole  $role = null) : \Pop\Nav\Nav

Set a AclRole object (alias method)

Parameters

\Pop\Acl\AclRole $role

Returns

\Pop\Nav\Nav

addRole()

addRole(\Pop\Acl\AclRole  $role = null) : \Pop\Nav\Nav

Add a AclRole object

Parameters

\Pop\Acl\AclRole $role

Returns

\Pop\Nav\Nav

addRoles()

addRoles(array  $roles) : \Pop\Nav\Nav

Add AclRole objects

Parameters

array $roles

Returns

\Pop\Nav\Nav

setAclStrict()

setAclStrict(boolean  $strict) : \Pop\Nav\Nav

Set the Acl object as strict evaluation

Parameters

boolean $strict

Returns

\Pop\Nav\Nav

setIndent()

setIndent(string  $indent) : \Pop\Nav\Nav

Set the indent

Parameters

string $indent

Returns

\Pop\Nav\Nav

setBaseUrl()

setBaseUrl(string  $baseUrl) : \Pop\Nav\Nav

Set the base URL

Parameters

string $baseUrl

Returns

\Pop\Nav\Nav

isReturnFalse()

isReturnFalse() : boolean

Set the return false flag

Returns

boolean

isAclStrict()

isAclStrict() : boolean

Determine if the Acl object is set as strict evaluation

Returns

boolean

getTree()

getTree() : array

Get the nav tree

Returns

array

getConfig()

getConfig() : array

Get the config

Returns

array

getAcl()

getAcl() : \Pop\Acl\Acl

Get the Acl object

Returns

\Pop\Acl\Acl

hasRoles()

hasRoles() : boolean

Determine if there are roles

Returns

boolean

hasRole()

hasRole(string  $name) : boolean

Determine if there is a certain role

Parameters

string $name

Returns

boolean

getRoles()

getRoles() : array

Get the AclRole objects

Returns

array

getRole()

getRole(string  $name) : \Pop\Acl\AclRole

Get a AclRole object

Parameters

string $name

Returns

\Pop\Acl\AclRole

getIndent()

getIndent() : string

Get the indent

Returns

string

getBaseUrl()

getBaseUrl() : string

Get the base URL

Returns

string

build()

build() : \Pop\Nav\Nav

Build the nav object

Returns

\Pop\Nav\Nav

rebuild()

rebuild() : \Pop\Nav\Nav

Re-build the nav object

Returns

\Pop\Nav\Nav

nav()

nav() : \Pop\Dom\Child

Get the nav object

Returns

\Pop\Dom\Child

render()

render() : string

Render the nav object

Returns

string

__toString()

__toString() : string

Render Nav object to string

Returns

string

traverseTree()

traverseTree(array  $tree, string  $branch, array  $newLeaf, integer  $pos = null, boolean  $prepend = false, integer  $depth) : array

Traverse tree to insert new leaf

Parameters

array $tree
string $branch
array $newLeaf
integer $pos
boolean $prepend
integer $depth

Returns

array

traverse()

traverse(array  $tree, integer  $depth = 1, string  $parentHref = null) : \Pop\Dom\Child

Traverse the config object

Parameters

array $tree
integer $depth
string $parentHref

Throws

\Pop\Nav\Exception

Returns

\Pop\Dom\Child