PHP 클래스 SiteNavModule, vanilla

By default, global items display no matter the section we're in. If a section is not specified, the item is added to the SECTION_DEFAULT. If we are in a section without a custom nav, these items will display. We can force the module to display any section menus by setting the currentSections property. Beware, you'll need to handle the user preference saving if you do this. TODO: Handle the dropdown menu case.
상속: extends NavModule
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$currentSections array
$initStaticFired boolean
$sectionItems array

공개 메소드들

메소드 설명
addGroup ( string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addGroupIf ( array | boolean | string $isAllowed = true, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addGroupToGlobals ( string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addGroupToGlobalsIf ( $isAllowed, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addGroupToSection ( $section, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addGroupToSectionIf ( $isAllowed, $section, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
addLink ( string $text, string $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addLinkIf ( array | boolean | string $isAllowed, string $text, string $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addLinkToGlobals ( $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addLinkToGlobalsIf ( boolean $isAllowed = true, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addLinkToSection ( $section, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addLinkToSectionIf ( $isAllowed, $section, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
addSectionItems ( array $section )
getCurrentSections ( ) : array
prepare ( ) : boolean
removeItem ( string $key ) Remove an item from the nested set.
setCurrentSections ( array $currentSections )

메소드 상세

addGroup() 공개 메소드

public addGroup ( string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$text string
$key string
$cssClass string
$sort array
$modifiers array

addGroupIf() 공개 메소드

public addGroupIf ( array | boolean | string $isAllowed = true, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$isAllowed array | boolean | string
$text string
$key string
$cssClass string
$sort array
$modifiers array

addGroupToGlobals() 공개 메소드

public addGroupToGlobals ( string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$text string
$key string
$cssClass string
$sort array
$modifiers array

addGroupToGlobalsIf() 공개 메소드

public addGroupToGlobalsIf ( $isAllowed, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$isAllowed
$text string
$key string
$cssClass string
$sort array
$modifiers array

addGroupToSection() 공개 메소드

public addGroupToSection ( $section, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$section
$text string
$key string
$cssClass string
$sort array
$modifiers array

addGroupToSectionIf() 공개 메소드

public addGroupToSectionIf ( $isAllowed, $section, string $text = '', string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [] )
$isAllowed
$section
$text string
$key string
$cssClass string
$sort array
$modifiers array

addLinkIf() 공개 메소드

public addLinkIf ( array | boolean | string $isAllowed, string $text, string $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
$isAllowed array | boolean | string
$text string
$url string
$key string
$cssClass string
$sort array
$modifiers array
$disabled boolean

addLinkToGlobals() 공개 메소드

public addLinkToGlobals ( $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
$text
$url
$key string
$cssClass string
$sort array
$modifiers array
$disabled boolean

addLinkToGlobalsIf() 공개 메소드

public addLinkToGlobalsIf ( boolean $isAllowed = true, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
$isAllowed boolean
$text
$url
$key string
$cssClass string
$sort array
$modifiers array
$disabled boolean

addLinkToSection() 공개 메소드

public addLinkToSection ( $section, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
$section
$text
$url
$key string
$cssClass string
$sort array
$modifiers array
$disabled boolean

addLinkToSectionIf() 공개 메소드

public addLinkToSectionIf ( $isAllowed, $section, $text, $url, string $key = '', string $cssClass = '', array $sort = [], array $modifiers = [], boolean $disabled = false )
$isAllowed
$section
$text
$url
$key string
$cssClass string
$sort array
$modifiers array
$disabled boolean

addSectionItems() 공개 메소드

public addSectionItems ( array $section )
$section array

getCurrentSections() 공개 메소드

public getCurrentSections ( ) : array
리턴 array

prepare() 공개 메소드

public prepare ( ) : boolean
리턴 boolean

removeItem() 공개 메소드

Remove an item from the nested set.
public removeItem ( string $key )
$key string The key of the item to remove, separated by dots.

setCurrentSections() 공개 메소드

public setCurrentSections ( array $currentSections )
$currentSections array

프로퍼티 상세

$currentSections 보호되어 있는 프로퍼티

protected array $currentSections
리턴 array

$initStaticFired 보호되어 있는 정적으로 프로퍼티

protected static bool $initStaticFired
리턴 boolean

$sectionItems 보호되어 있는 정적으로 프로퍼티

protected static array $sectionItems
리턴 array