PHP Класс Menu\Items\Item

Наследование: extends Menu\Traits\MenuObject
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$patterns array Array of patterns to match the active state

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

Метод Описание
__construct ( ItemList $parent, Tag $value, array $children = null, array $element = null, string $beforeContent = null, string $afterContent = null ) Create a new item instance
getContent ( ) : Menu\Traits\Content Get the Item's content
getElement ( ) : string Get the Item's element
getRequest ( ) : Request Get the Request instance
hasActiveChild ( ) : boolean Check if this item has an active child
hasChildren ( )
isActive ( ) : boolean Check if this item is active
render ( $depth ) : string Render the item
setActivePatterns ( string | array $pattern, string $name = null ) Add an pattern to $patterns array
setAfterContent ( string $value ) Set the value to be inserted after the item's content
setBeforeContent ( string $value ) Set the value to be inserted before the item's content
setElement ( string $element = null ) Set the Item's element
stop ( ) : ItemList Break off a chain

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

Метод Описание
getUrl ( ) : string Get the url of the Item's content
hasActivePatterns ( ) : boolean Check if this item has an active pattern

Приватные методы

Метод Описание
addActiveClasses ( ) Add the various active classes to an array of attributes

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

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

Create a new item instance
public __construct ( ItemList $parent, Tag $value, array $children = null, array $element = null, string $beforeContent = null, string $afterContent = null )
$parent ItemList The parent
$value HtmlObject\Traits\Tag The content
$children array Facultative children ItemLists
$element array The Item element
$beforeContent string String to add before the content
$afterContent string String to add after the content

getContent() публичный метод

Get the Item's content
public getContent ( ) : Menu\Traits\Content
Результат Menu\Traits\Content

getElement() публичный метод

Get the Item's element
public getElement ( ) : string
Результат string

getRequest() публичный метод

Get the Request instance
public getRequest ( ) : Request
Результат Request

getUrl() защищенный метод

Get the url of the Item's content
protected getUrl ( ) : string
Результат string

hasActiveChild() публичный метод

Check if this item has an active child
public hasActiveChild ( ) : boolean
Результат boolean

hasActivePatterns() защищенный метод

Check if this item has an active pattern
protected hasActivePatterns ( ) : boolean
Результат boolean

hasChildren() публичный метод

public hasChildren ( )

isActive() публичный метод

Check if this item is active
public isActive ( ) : boolean
Результат boolean

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

Render the item
public render ( $depth ) : string
Результат string

setActivePatterns() публичный метод

Add an pattern to $patterns array
public setActivePatterns ( string | array $pattern, string $name = null )
$pattern string | array The pattern
$name string Its name

setAfterContent() публичный метод

Set the value to be inserted after the item's content
public setAfterContent ( string $value )
$value string The value to insert

setBeforeContent() публичный метод

Set the value to be inserted before the item's content
public setBeforeContent ( string $value )
$value string The value to insert

setElement() публичный метод

Set the Item's element
public setElement ( string $element = null )
$element string

stop() публичный метод

Break off a chain
public stop ( ) : ItemList
Результат ItemList

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

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

Array of patterns to match the active state
protected array $patterns
Результат array