ToolbarButton

The ToolbarButton class.

abstract
since

4.0.0

package

Joomla CMS

Methods

__call

Magiix method to adapt option accessors.

__call( name, mixed||string|int args) : 
throws

LogicException

since

4.0.0

Arguments

name

stringThe method name.

args

array<string|int, mixed>The method arguments.

Response

mixed

__construct

Init this class.

__construct( name = '',  text = '', mixed||string|int options = []) : 
since

4.0.0

throws

InvalidArgumentException

Arguments

name

stringName of this button.

text

stringThe button text, will auto translate.

options

array<string|int, mixed>Button options.

Response

mixed

attributes

attributes(mixed||string|int value) : 

Arguments

value

array<string|int, mixed>

Response

self

buttonClass

buttonClass( value) : 

Arguments

value

string

Response

self

ensureUniqueId

Make sure the id is unique

ensureUniqueId( id) : 
since

4.0.0

Arguments

id

stringThe id string.

Response

string

fetchButton

Get the button

fetchButton() : 
abstract deprecated

Defined in the final button class

since

3.0

deprecated

4.3 will be removed in 6.0 Use render() instead.

Response

string

fetchIconClass

Method to get the CSS class name for an icon identifier

fetchIconClass( identifier) : 

Can be redefined in the final class

since

3.0

Arguments

identifier

stringIcon identification string

Response

stringCSS class name

fetchId

Get the button CSS Id.

fetchId() : 
since

3.0

Response

stringButton CSS Id

findOptionName

Find field option name from accessors.

findOptionName( name) : bool|string
static
since

4.0.0

Arguments

name

stringThe field name.

Response

bool|string

form

form( value) : 

Arguments

value

string

Response

self

formValidation

formValidation( value) : 

Arguments

value

bool

Response

self

getAccessors

Method to configure available option accessors.

getAccessors() : mixed||string|int
static
since

4.0.0

Response

array<string|int, mixed>

getAttributes

getAttributes() : mixed||string|int

Response

array<string|int, mixed>

getButtonClass

getButtonClass() : 

Response

string

getForm

getForm() : 

Response

string

getFormValidation

getFormValidation() : 

Response

bool

getIcon

getIcon() : 

Response

string

getLayout

Get layout path.

getLayout() : 
since

4.0.0

Response

string

getListCheck

getListCheck() : 

Response

bool

getListCheckMessage

getListCheckMessage() : 

Response

string

getName

Get button name.

getName() : 
since

4.0.0

Response

string

getOnclick

getOnclick() : 

Response

string

getOption

Get single option value.

getOption( name,  default = null) : 
since

4.0.0

Arguments

name

stringThe option name.

default

mixedThe default value if this name not exists.

Response

mixed

getOptions

Get button options.

getOptions() : mixed||string|int
since

4.0.0

Response

array<string|int, mixed>

getParent

Get parent toolbar instance.

getParent() : \Joomla\CMS\Toolbar\Toolbar
since

4.0.0

Response

Toolbar

getTask

getTask() : 

Response

string

getText

getText() : 

Response

string

icon

icon( value) : 

Arguments

value

string

Response

self

layout

Set layout path.

layout( layout) : 
since

4.0.0

Arguments

layout

stringThe layout path name to render.

Response

staticReturn self to support chaining.

listCheck

listCheck( value) : 

Arguments

value

bool

Response

self

listCheckMessage

listCheckMessage( value) : 

Arguments

value

string

Response

self

name

Set button name.

name( name) : 
since

4.0.0

Arguments

name

stringThe button name.

Response

staticReturn self to support chaining.

onclick

onclick( value) : 

Arguments

value

string

Response

self

prepareOptions

Prepare options for this button.

prepareOptions(mixed||string|int &options) : 
since

4.0.0

Arguments

options

array<string|int, mixed>The options about this button.

Response

void

render

Get the HTML to render the button

render(mixed||string|int &definition = null) : 
since

3.0

throws

Exception

Arguments

definition

array<string|int, mixed>Parameters to be passed

Response

string

renderButton

Render button HTML.

renderButton(mixed||string|int &options) : 
since

4.0.0

Arguments

options

array<string|int, mixed>The button options.

Response

stringThe button HTML.

setOption

Set option value.

setOption( name,  value) : 
since

4.0.0

Arguments

name

stringThe option name to store value.

value

mixedThe option value.

Response

static

setOptions

Set all options.

setOptions(mixed||string|int options) : 
since

4.0.0

Arguments

options

array<string|int, mixed>The button options.

Response

staticReturn self to support chaining.

setParent

Set parent Toolbar instance.

setParent(\Joomla\CMS\Toolbar\Toolbar parent) : 
since

4.0.0

Arguments

parent

ToolbarThe parent Toolbar instance to set.

Response

staticReturn self to support chaining.

task

task( value) : 

Arguments

value

string

Response

self

text

text( value) : 

Arguments

value

string

Response

self

Properties

name

Name of this button.

since

4.0.0

Type(s)

string

parent

Reference to the object that instantiated the element

since

4.0.0

Type(s)

Toolbar

layout

The layout path to render this button.

since

4.0.0

Type(s)

string

options

Button options.

since

4.0.0

Type(s)

array<string|int, mixed>

idCounter

Used to track an ids, to avoid duplication

static
since

4.0.0

Type(s)

array<string|int, mixed>