PHP Interface PhpSchool\CliMenu\MenuItem\MenuItemInterface

Author: Michael Woodward ([email protected])
Show file Open project: php-school/cli-menu Interface Usage Examples

Public Methods

Method Description
canSelect ( ) : boolean Can the item be selected
getRows ( MenuStyle $style, boolean $selected = false ) : array The output text for the item
getSelectAction ( ) : callable | void Execute the items callable if required
getText ( ) : string Return the raw string of text
hideItemExtra ( ) Disable showing item extra
showItemExtra ( ) Enable showing item extra
showsItemExtra ( ) : boolean Whether or not the menu item is showing the menustyle extra value

Method Details

canSelect() public method

Can the item be selected
public canSelect ( ) : boolean
return boolean

getRows() public method

The output text for the item
public getRows ( MenuStyle $style, boolean $selected = false ) : array
$style PhpSchool\CliMenu\MenuStyle
$selected boolean
return array

getSelectAction() public method

Execute the items callable if required
public getSelectAction ( ) : callable | void
return callable | void

getText() public method

Return the raw string of text
public getText ( ) : string
return string

hideItemExtra() public method

Disable showing item extra
public hideItemExtra ( )

showItemExtra() public method

Enable showing item extra
public showItemExtra ( )

showsItemExtra() public method

Whether or not the menu item is showing the menustyle extra value
public showsItemExtra ( ) : boolean
return boolean