PHP Класс Caffeinated\Menus\Item

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

Открытые свойства

Свойство Тип Описание
$attributes array
$divider array
$id integer
$parent integer
$slug string
$title string

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

Свойство Тип Описание
$builder Builder
$data array

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

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

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

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

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

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

Return either a property or attribute item value.
public __get ( string $property ) : string
$property string
Результат string

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

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

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

public active ( $pattern = null )

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

Adds a sub item to the menu.
public add ( string $title, array | string $options = '' ) : Item
$title string
$options array | string
Результат Item

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

Appends HTML to the item.
public append ( string $html ) : Item
$html string
Результат Item

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

Return the title with the icon appended automatically.
public appendIcon ( ) : string
Результат string

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

Assign or fetch the desired attribute.
public attribute ( array | string $attribute, string $value = null ) : mixed
$attribute array | string
$value string
Результат mixed

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

Fetch the formatted attributes for the item in HTML.
public attributes ( ) : string
Результат string

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

public builder ( )

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

public can ( $permissions )

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

public canAtLeast ( $permissions )

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

Decide if the item should be active.
public checkActiveStatus ( ) : null
Результат null

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

Returns all children underneath the menu item.
public children ( ) : Caffeinated\Menus\Collection
Результат Caffeinated\Menus\Collection

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

Set or get an item's metadata.
public data ( ) : string | Item
Результат string | Item

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

Insert a divider after the item.
public divide ( array $attributes = [] ) : void
$attributes array
Результат void

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

Get all attributes.
public getAttributes ( ) : array
Результат array

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

Determines if the menu item has children.
public hasChildren ( ) : boolean
Результат boolean

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

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"
Результат Item

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

Returns bool value if item is active or not.
public isActive ( ) : boolean
Результат boolean

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

Prepends HTML to the item.
public prepend ( string $html ) : Item
$html string
Результат Item

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

Return the title with the icon prepended automatically.
public prependIcon ( ) : string
Результат string

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

Generates a valid URL for the menu item.
public url ( ) : string
Результат string

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

$attributes публичное свойство

public array $attributes
Результат array

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

protected Builder,Caffeinated\Menus $builder
Результат Builder

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

protected array $data
Результат array

$divider публичное свойство

public array $divider
Результат array

$id публичное свойство

public int $id
Результат integer

$parent публичное свойство

public int $parent
Результат integer

$slug публичное свойство

public string $slug
Результат string

$title публичное свойство

public string $title
Результат string