PHP Класс Gc\Component\Navigation

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$basePath string Base path for urls
$documents array List of \Gc\Document\Model
$requestUri string Request uri
$useActiveBranch boolean Use active branch

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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

checkDocuments() защищенный Метод

Check documents
protected checkDocuments ( mixed $documents ) : array
$documents mixed List of Document\Model
Результат array

getBasePath() публичный Метод

Get base Path
public getBasePath ( ) : string
Результат string

hasActiveChildren() защищенный Метод

Check if page has active children
protected hasActiveChildren ( array $pages ) : boolean
$pages array List of pages as array
Результат boolean

render() публичный Метод

Render navigation
public render ( array $documents = null, string $parentUrl = null ) : array
$documents array Let of \Gc\Document\Model
$parentUrl string Parent url
Результат array

renderChildren() защищенный Метод

Render children
protected renderChildren ( Model $document, string $parentUrl, &$data ) : void
$document Gc\Document\Model Document model
$parentUrl string Parent url
Результат void

setBasePath() публичный Метод

Set base path for urls
public setBasePath ( string $path ) : Navigation
$path string Path
Результат Navigation

useActiveBranch() публичный Метод

Constructor, initialize documents
public useActiveBranch ( boolean $boolean = null ) : mixte
$boolean boolean Set the branch is active or only one page
Результат mixte

Описание свойств

$basePath защищенное свойство

Base path for urls
protected string $basePath
Результат string

$documents защищенное свойство

List of \Gc\Document\Model
protected array $documents
Результат array

$requestUri защищенное свойство

Request uri
protected string $requestUri
Результат string

$useActiveBranch защищенное свойство

Use active branch
protected bool $useActiveBranch
Результат boolean