PHP Class Gc\Component\Navigation

Datei anzeigen Open project: gotcms/gotcms Class Usage Examples

Protected Properties

Property Type Description
$basePath string Base path for urls
$documents array List of \Gc\Document\Model
$requestUri string Request uri
$useActiveBranch boolean Use active branch

Public Methods

Method Description
__construct ( integer $documentId, boolean $activeBranch = false ) Constructor, initialize documents
getBasePath ( ) : string Get base Path
render ( array $documents = null, string $parentUrl = null ) : array Render navigation
setBasePath ( string $path ) : Navigation Set base path for urls
useActiveBranch ( boolean $boolean = null ) : mixte Constructor, initialize documents

Protected Methods

Method Description
checkDocuments ( mixed $documents ) : array Check documents
hasActiveChildren ( array $pages ) : boolean Check if page has active children
renderChildren ( Model $document, string $parentUrl, &$data ) : void Render children

Method Details

__construct() public method

Constructor, initialize documents
public __construct ( integer $documentId, boolean $activeBranch = false )
$documentId integer Document id
$activeBranch boolean Use active branch or not

checkDocuments() protected method

Check documents
protected checkDocuments ( mixed $documents ) : array
$documents mixed List of Document\Model
return array

getBasePath() public method

Get base Path
public getBasePath ( ) : string
return string

hasActiveChildren() protected method

Check if page has active children
protected hasActiveChildren ( array $pages ) : boolean
$pages array List of pages as array
return boolean

render() public method

Render navigation
public render ( array $documents = null, string $parentUrl = null ) : array
$documents array Let of \Gc\Document\Model
$parentUrl string Parent url
return array

renderChildren() protected method

Render children
protected renderChildren ( Model $document, string $parentUrl, &$data ) : void
$document Gc\Document\Model Document model
$parentUrl string Parent url
return void

setBasePath() public method

Set base path for urls
public setBasePath ( string $path ) : Navigation
$path string Path
return Navigation

useActiveBranch() public method

Constructor, initialize documents
public useActiveBranch ( boolean $boolean = null ) : mixte
$boolean boolean Set the branch is active or only one page
return mixte

Property Details

$basePath protected_oe property

Base path for urls
protected string $basePath
return string

$documents protected_oe property

List of \Gc\Document\Model
protected array $documents
return array

$requestUri protected_oe property

Request uri
protected string $requestUri
return string

$useActiveBranch protected_oe property

Use active branch
protected bool $useActiveBranch
return boolean