PHP Class Caffeinated\Menus\Item

Afficher le fichier Open project: caffeinated/menus Class Usage Examples

Méthodes publiques

Свойство Type Description
$attributes array
$divider array
$id integer
$parent integer
$slug string
$title string

Protected Properties

Свойство Type Description
$builder Builder
$data array

Méthodes publiques

Méthode Description
__construct ( Builder $builder, integer $id, string $title, array | string $options ) Constructor.
__get ( string $property ) : string Return either a property or attribute item value.
activate ( Item $item = null )
active ( $pattern = null )
add ( string $title, array | string $options = '' ) : Item Adds a sub item to the menu.
append ( string $html ) : Item Appends HTML to the item.
appendIcon ( ) : string Return the title with the icon appended automatically.
attribute ( array | string $attribute, string $value = null ) : mixed Assign or fetch the desired attribute.
attributes ( ) : string Fetch the formatted attributes for the item in HTML.
builder ( )
can ( $permissions )
canAtLeast ( $permissions )
checkActiveStatus ( ) : null Decide if the item should be active.
children ( ) : Caffeinated\Menus\Collection Returns all children underneath the menu item.
configureLink ( array | string $options ) : null Configures the link for the menu item.
data ( ) : string | Item Set or get an item's metadata.
divide ( array $attributes = [] ) : void Insert a divider after the item.
getAttributes ( ) : array Get all attributes.
hasChildren ( ) : boolean Determines if the menu item has children.
icon ( string $icon, string $type = 'fontawesome' ) : Item Appends the specified icon to the item.
isActive ( ) : boolean Returns bool value if item is active or not.
prepend ( string $html ) : Item Prepends HTML to the item.
prependIcon ( ) : string Return the title with the icon prepended automatically.
url ( ) : string Generates a valid URL for the menu item.

Method Details

__construct() public méthode

Constructor.
public __construct ( Builder $builder, integer $id, string $title, array | string $options )
$builder Builder
$id integer
$title string
$options array | string

__get() public méthode

Return either a property or attribute item value.
public __get ( string $property ) : string
$property string
Résultat string

activate() public méthode

public activate ( Item $item = null )
$item Item

active() public méthode

public active ( $pattern = null )

add() public méthode

Adds a sub item to the menu.
public add ( string $title, array | string $options = '' ) : Item
$title string
$options array | string
Résultat Item

append() public méthode

Appends HTML to the item.
public append ( string $html ) : Item
$html string
Résultat Item

appendIcon() public méthode

Return the title with the icon appended automatically.
public appendIcon ( ) : string
Résultat string

attribute() public méthode

Assign or fetch the desired attribute.
public attribute ( array | string $attribute, string $value = null ) : mixed
$attribute array | string
$value string
Résultat mixed

attributes() public méthode

Fetch the formatted attributes for the item in HTML.
public attributes ( ) : string
Résultat string

builder() public méthode

public builder ( )

can() public méthode

public can ( $permissions )

canAtLeast() public méthode

public canAtLeast ( $permissions )

checkActiveStatus() public méthode

Decide if the item should be active.
public checkActiveStatus ( ) : null
Résultat null

children() public méthode

Returns all children underneath the menu item.
public children ( ) : Caffeinated\Menus\Collection
Résultat Caffeinated\Menus\Collection

data() public méthode

Set or get an item's metadata.
public data ( ) : string | Item
Résultat string | Item

divide() public méthode

Insert a divider after the item.
public divide ( array $attributes = [] ) : void
$attributes array
Résultat void

getAttributes() public méthode

Get all attributes.
public getAttributes ( ) : array
Résultat array

hasChildren() public méthode

Determines if the menu item has children.
public hasChildren ( ) : boolean
Résultat boolean

icon() public méthode

Appends the specified icon to the item.
public icon ( string $icon, string $type = 'fontawesome' ) : Item
$icon string
$type string Can be either "fontawesome" or "glyphicon"
Résultat Item

isActive() public méthode

Returns bool value if item is active or not.
public isActive ( ) : boolean
Résultat boolean

prepend() public méthode

Prepends HTML to the item.
public prepend ( string $html ) : Item
$html string
Résultat Item

prependIcon() public méthode

Return the title with the icon prepended automatically.
public prependIcon ( ) : string
Résultat string

url() public méthode

Generates a valid URL for the menu item.
public url ( ) : string
Résultat string

Property Details

$attributes public_oe property

public array $attributes
Résultat array

$builder protected_oe property

protected Builder,Caffeinated\Menus $builder
Résultat Builder

$data protected_oe property

protected array $data
Résultat array

$divider public_oe property

public array $divider
Résultat array

$id public_oe property

public int $id
Résultat integer

$parent public_oe property

public int $parent
Résultat integer

$slug public_oe property

public string $slug
Résultat string

$title public_oe property

public string $title
Résultat string