ItemActionMenu
extends MenuConfig
in package
Class ItemActionMenu.
Describe ItemActionMenu
Table of Contents
Properties
Methods
- __construct() : mixed
- MenuConfig constructor.
- addItem() : MenuItem
- Add more menu items.
- asButton() : self
- setVariant() : MenuConfig
- toArray() : array<string, mixed>
- withDelete() : MenuItem
- Add "deleteItem".
- withDeleteForm() : MenuItem
- Add "getDeleteForm".
- withEdit() : MenuItem
- Add "editItem".
Properties
$items
protected
Collection<string|int, MenuItem>
$items
$variant
protected
string|null
$variant
= null
Methods
__construct()
MenuConfig constructor.
public
__construct() : mixed
addItem()
Add more menu items.
public
addItem(string $name) : MenuItem
Parameters
- $name : string
Return values
MenuItemasButton()
public
asButton() : self
Return values
selfsetVariant()
public
setVariant(string|null $variant) : MenuConfig
Parameters
- $variant : string|null
Return values
MenuConfigtoArray()
public
toArray() : array<string, mixed>
Return values
array<string, mixed>withDelete()
Add "deleteItem".
public
withDelete([string|null $label = null ][, array<string|int, mixed>|null $confirmation = null ][, array<string|int, mixed> $showWhen = [] ]) : MenuItem
Parameters
- $label : string|null = null
- $confirmation : array<string|int, mixed>|null = null
- $showWhen : array<string|int, mixed> = []
Return values
MenuItemwithDeleteForm()
Add "getDeleteForm".
public
withDeleteForm([string|null $label = null ][, bool $reload = true ][, array<string|int, mixed> $showWhen = [] ]) : MenuItem
Parameters
- $label : string|null = null
- $reload : bool = true
- $showWhen : array<string|int, mixed> = []
Return values
MenuItemwithEdit()
Add "editItem".
public
withEdit([string|null $label = null ]) : MenuItem
Parameters
- $label : string|null = null