PHP 클래스 Lavary\Menu\Item

파일 보기 프로젝트 열기: lavary/laravel-menu 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$attributes array Attributes of menu item
$divider array Item's seprator from the rest of the items, if it has any.
$isActive boolean Flag for active state
$nickname string Item's title in camelCase
$title string Item's title

보호된 프로퍼티들

프로퍼티 타입 설명
$builder Lavary\Menu\Menu Reference to the menu builder
$data array Extra information attached to the menu item
$id integer The ID of the menu item
$parent integer Parent Id of the menu item

공개 메소드들

메소드 설명
__construct ( Menu $builder, $id, string $title, $options ) : void Creates a new Lavary\Menu\MenuItem instance.
__get ( $prop ) : string Search in meta data if a property doesn't exist otherwise return the property
activate ( Item $item = null ) Activat the item
active ( $pattern = null ) : Lavary\Menu\Item Make the item active
add ( string $title, string | array $options = '' ) : void Creates a sub Item
all ( ) : Lavary\Menu\Collection Returns all childeren of the item
append ( $html ) : Lavary\Menu\Item Appends text or html to the item
attr ( ) : string | Lavary\Menu\Item Add attributes to the item
cascade_data ( array $args = [] ) Cascade data to children
checkActivationStatus ( ) Decide if the item should be active
children ( ) : Lavary\Menu\Collection Returns childeren of the item
data ( ) : string | Lavary\Menu\Item Set or get items's meta data
divide ( array $attributes = [] ) : void Insert a seprator after the item
group ( array $attributes, callable $closure ) : void Group children of the item
hasChildren ( ) : boolean Checks if the item has any children
hasProperty ( String $property ) : boolean Check if propery exists either in the class or the meta collection
id ( mixed $id = null ) : /Lavary/Menu/Item Set id for the item manually
nickname ( string $nickname = null ) : /Lavary/Menu/Item Set nickname for the item manually
prepend ( $html ) : Lavary\Menu\Item Prepends text or html to the item
raw ( $title, array $options = [] ) : Lavary\Menu\Item Add a plain text item
url ( ) : string Generate URL for link

메소드 상세

__construct() 공개 메소드

Creates a new Lavary\Menu\MenuItem instance.
public __construct ( Menu $builder, $id, string $title, $options ) : void
$builder Menu
$title string
리턴 void

__get() 공개 메소드

Search in meta data if a property doesn't exist otherwise return the property
public __get ( $prop ) : string
리턴 string

activate() 공개 메소드

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

active() 공개 메소드

Make the item active
public active ( $pattern = null ) : Lavary\Menu\Item
리턴 Lavary\Menu\Item

add() 공개 메소드

Creates a sub Item
public add ( string $title, string | array $options = '' ) : void
$title string
$options string | array
리턴 void

all() 공개 메소드

Returns all childeren of the item
public all ( ) : Lavary\Menu\Collection
리턴 Lavary\Menu\Collection

append() 공개 메소드

Appends text or html to the item
public append ( $html ) : Lavary\Menu\Item
리턴 Lavary\Menu\Item

attr() 공개 메소드

Add attributes to the item
public attr ( ) : string | Lavary\Menu\Item
리턴 string | Lavary\Menu\Item

cascade_data() 공개 메소드

Cascade data to children
public cascade_data ( array $args = [] )
$args array

checkActivationStatus() 공개 메소드

Decide if the item should be active

children() 공개 메소드

Returns childeren of the item
public children ( ) : Lavary\Menu\Collection
리턴 Lavary\Menu\Collection

data() 공개 메소드

Set or get items's meta data
public data ( ) : string | Lavary\Menu\Item
리턴 string | Lavary\Menu\Item

divide() 공개 메소드

Insert a seprator after the item
public divide ( array $attributes = [] ) : void
$attributes array
리턴 void

group() 공개 메소드

Group children of the item
public group ( array $attributes, callable $closure ) : void
$attributes array
$closure callable
리턴 void

hasChildren() 공개 메소드

Checks if the item has any children
public hasChildren ( ) : boolean
리턴 boolean

hasProperty() 공개 메소드

Check if propery exists either in the class or the meta collection
public hasProperty ( String $property ) : boolean
$property String
리턴 boolean

id() 공개 메소드

Set id for the item manually
public id ( mixed $id = null ) : /Lavary/Menu/Item
$id mixed
리턴 /Lavary/Menu/Item

nickname() 공개 메소드

Set nickname for the item manually
public nickname ( string $nickname = null ) : /Lavary/Menu/Item
$nickname string
리턴 /Lavary/Menu/Item

prepend() 공개 메소드

Prepends text or html to the item
public prepend ( $html ) : Lavary\Menu\Item
리턴 Lavary\Menu\Item

raw() 공개 메소드

Add a plain text item
public raw ( $title, array $options = [] ) : Lavary\Menu\Item
$options array
리턴 Lavary\Menu\Item

url() 공개 메소드

Generate URL for link
public url ( ) : string
리턴 string

프로퍼티 상세

$attributes 공개적으로 프로퍼티

Attributes of menu item
public array $attributes
리턴 array

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

Reference to the menu builder
protected Lavary\Menu\Menu $builder
리턴 Lavary\Menu\Menu

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

Extra information attached to the menu item
protected array $data
리턴 array

$divider 공개적으로 프로퍼티

Item's seprator from the rest of the items, if it has any.
public array $divider
리턴 array

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

The ID of the menu item
protected int $id
리턴 integer

$isActive 공개적으로 프로퍼티

Flag for active state
public bool $isActive
리턴 boolean

$nickname 공개적으로 프로퍼티

Item's title in camelCase
public string $nickname
리턴 string

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

Parent Id of the menu item
protected int $parent
리턴 integer

$title 공개적으로 프로퍼티

Item's title
public string $title
리턴 string