PHP Class Pop\Nav\Nav

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$acl Pop\Auth\Acl Acl object
$childLevel integer Nav child level
$config array Nav config
$nav Pop\Dom\Child Parent nav element
$parentLevel integer Nav parent level
$returnFalse boolean Return false flag
$role Pop\Auth\Role Role object
$tree array Nav tree

Public Methods

Method Description
__construct ( array $tree = null, array $config = null ) : self Constructor
__toString ( ) : string Render Nav object to string
addBranch ( array $branch, boolean $prepend = false ) : Nav Add to a nav tree branch
addLeaf ( string $branch, array $leaf, integer $pos = null, boolean $prepend = false ) : Nav Add to a leaf to nav tree branch
build ( ) : Nav Build the nav object
factory ( array $tree = null, array $config = [] ) : self Static method to instantiate the nav object and return itself to facilitate chaining methods together.
getAcl ( ) : Acl Get the Acl object
getConfig ( ) : array Get the config
getRole ( ) : Role Get the Role object
getTree ( ) : array Get the nav tree
isReturnFalse ( ) : boolean Set the return false flag
nav ( ) : Child Get the nav object
rebuild ( ) : Nav Re-build the nav object
render ( boolean $ret = false ) : mixed Render the nav object
returnFalse ( boolean $return ) : Nav Set the return false flag
setAcl ( Acl $acl = null ) : Nav Set the Acl object
setConfig ( array $config = null ) : Nav Set the nav tree
setRole ( Role $role = null ) : Nav Set the Role object
setTree ( array $tree = null ) : Nav Set the nav tree

Protected Methods

Method Description
traverse ( array $tree, integer $depth = 1, string $parentHref = null ) : Child Traverse the config object
traverseTree ( array $tree, string $branch, array $newLeaf, integer $pos = null, boolean $prepend = false, integer $depth ) : array Traverse tree to insert new leaf

Method Details

__construct() public method

Instantiate the nav object
public __construct ( array $tree = null, array $config = null ) : self
$tree array
$config array
return self

__toString() public method

Render Nav object to string
public __toString ( ) : string
return string

addBranch() public method

Add to a nav tree branch
public addBranch ( array $branch, boolean $prepend = false ) : Nav
$branch array
$prepend boolean
return Nav

addLeaf() public method

Add to a leaf to nav tree branch
public addLeaf ( string $branch, array $leaf, integer $pos = null, boolean $prepend = false ) : Nav
$branch string
$leaf array
$pos integer
$prepend boolean
return Nav

build() public method

Build the nav object
public build ( ) : Nav
return Nav

factory() public static method

Static method to instantiate the nav object and return itself to facilitate chaining methods together.
public static factory ( array $tree = null, array $config = [] ) : self
$tree array
$config array
return self

getAcl() public method

Get the Acl object
public getAcl ( ) : Acl
return Pop\Auth\Acl

getConfig() public method

Get the config
public getConfig ( ) : array
return array

getRole() public method

Get the Role object
public getRole ( ) : Role
return Pop\Auth\Role

getTree() public method

Get the nav tree
public getTree ( ) : array
return array

isReturnFalse() public method

Set the return false flag
public isReturnFalse ( ) : boolean
return boolean

nav() public method

Get the nav object
public nav ( ) : Child
return Pop\Dom\Child

rebuild() public method

Re-build the nav object
public rebuild ( ) : Nav
return Nav

render() public method

Render the nav object
public render ( boolean $ret = false ) : mixed
$ret boolean
return mixed

returnFalse() public method

Set the return false flag
public returnFalse ( boolean $return ) : Nav
$return boolean
return Nav

setAcl() public method

Set the Acl object
public setAcl ( Acl $acl = null ) : Nav
$acl Pop\Auth\Acl
return Nav

setConfig() public method

Set the nav tree
public setConfig ( array $config = null ) : Nav
$config array
return Nav

setRole() public method

Set the Role object
public setRole ( Role $role = null ) : Nav
$role Pop\Auth\Role
return Nav

setTree() public method

Set the nav tree
public setTree ( array $tree = null ) : Nav
$tree array
return Nav

traverse() protected method

Traverse the config object
protected traverse ( array $tree, integer $depth = 1, string $parentHref = null ) : Child
$tree array
$depth integer
$parentHref string
return Pop\Dom\Child

traverseTree() protected method

Traverse tree to insert new leaf
protected traverseTree ( array $tree, string $branch, array $newLeaf, integer $pos = null, boolean $prepend = false, integer $depth ) : array
$tree array
$branch string
$newLeaf array
$pos integer
$prepend boolean
$depth integer
return array

Property Details

$acl protected property

Acl object
protected Acl,Pop\Auth $acl
return Pop\Auth\Acl

$childLevel protected property

Nav child level
protected int $childLevel
return integer

$config protected property

Nav config
protected array $config
return array

$nav protected property

Parent nav element
protected Child,Pop\Dom $nav
return Pop\Dom\Child

$parentLevel protected property

Nav parent level
protected int $parentLevel
return integer

$returnFalse protected property

Return false flag
protected bool $returnFalse
return boolean

$role protected property

Role object
protected Role,Pop\Auth $role
return Pop\Auth\Role

$tree protected property

Nav tree
protected array $tree
return array