PHP Class SideMenuModule, vanilla

Inheritance: extends Gdn_Module
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство Type Description
$AutoLinkGroups Should the group titles be autolinked to the first anchor in the group? Default TRUE.
$CssClass The class attribute to be applied to the root element of the breadcrumb. Default is none.
$EventName string | boolean
$HtmlId The html id attribute to be applied to the root element of the menu. Default is "Menu".
$Items An array of menu items.
$Sort An array of menu group names arranged in the order that the menu should be rendered.

Protected Properties

Свойство Type Description
$_Items array

Méthodes publiques

Méthode Description
__construct ( string $Sender = '' )
addItem ( $Group, $Text, boolean $Permission = false, array $Attributes = [] )
addLink ( $Group, $Text, $Url, boolean $Permission = false, array $Attributes = [] )
assetTarget ( ) : string
checkPermissions ( )
clearGroups ( )
highlightRoute ( $Route )
removeGroup ( $Group ) Removes an entire group of links, and the group itself, from the menu.
removeLink ( $Group, $Text )
removeLinks ( $Group ) Removes all links from a specific group.
toString ( string $HighlightRoute = '' ) : string Render the menu.

Méthodes protégées

Méthode Description
_Compare ( $A, null $B = null ) : integer | void
_CompareSort ( array $A, array $All ) : integer The sort is determined by looking at: a) The item's sort.

Method Details

_Compare() protected méthode

protected _Compare ( $A, null $B = null ) : integer | void
$A
$B null
Résultat integer | void

_CompareSort() protected méthode

b) Whether the item is after another. c) The order the item was added.
protected _CompareSort ( array $A, array $All ) : integer
$A array
$All array
Résultat integer

__construct() public méthode

public __construct ( string $Sender = '' )
$Sender string

addItem() public méthode

public addItem ( $Group, $Text, boolean $Permission = false, array $Attributes = [] )
$Group
$Text
$Permission boolean
$Attributes array

assetTarget() public méthode

public assetTarget ( ) : string
Résultat string

checkPermissions() public méthode

public checkPermissions ( )

clearGroups() public méthode

public clearGroups ( )

highlightRoute() public méthode

public highlightRoute ( $Route )
$Route

removeGroup() public méthode

Removes an entire group of links, and the group itself, from the menu.
public removeGroup ( $Group )

toString() public méthode

Render the menu.
public toString ( string $HighlightRoute = '' ) : string
$HighlightRoute string
Résultat string

Property Details

$AutoLinkGroups public_oe property

Should the group titles be autolinked to the first anchor in the group? Default TRUE.
public $AutoLinkGroups

$CssClass public_oe property

The class attribute to be applied to the root element of the breadcrumb. Default is none.
public $CssClass

$EventName public_oe property

public string|bool $EventName
Résultat string | boolean

$HtmlId public_oe property

The html id attribute to be applied to the root element of the menu. Default is "Menu".
public $HtmlId

$Items public_oe property

An array of menu items.
public $Items

$Sort public_oe property

An array of menu group names arranged in the order that the menu should be rendered.
public $Sort

$_Items protected_oe property

protected array $_Items
Résultat array