ToolbarButton

The ToolbarButton class.

abstract
since

4.0.0

package

Application

Methods

__call

Magiix method to adapt option accessors.

__call(string name, array args) : mixed
throws

\LogicException

since

4.0.0

Arguments

name

stringThe method name.

args

arrayThe method arguments.

Response

mixed

__construct

Init this class.

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

4.0.0

throws

\InvalidArgumentException

Arguments

name

stringName of this button.

text

stringThe button text, will auto translate.

options

arrayButton options.

Response

mixed

attributes

attributes(array value) : self

Arguments

value

array

Response

self

buttonClass

buttonClass(string value) : self

Arguments

value

string

Response

self

ensureUniqueId

Make sure the id is unique

ensureUniqueId(string id) : string
since

4.0.0

Arguments

id

stringThe id string.

Response

string

fetchButton

Get the button

fetchButton() : string
abstract deprecated

Defined in the final button class

since

3.0

deprecated

5.0 Use render() instead.

Response

string

fetchIconClass

Method to get the CSS class name for an icon identifier

fetchIconClass(string identifier) : string

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() : string
since

3.0

Response

stringButton CSS Id

findOptionName

Find field option name from accessors.

findOptionName(string name) : bool|string
static
since

4.0.0

Arguments

name

stringThe field name.

Response

bool|string

form

form(string value) : self

Arguments

value

string

Response

self

formValidation

formValidation(bool value) : self

Arguments

value

bool

Response

self

getAccessors

Method to configure available option accessors.

getAccessors() : array
static
since

4.0.0

Response

array

getAttributes

getAttributes() : array

Response

array

getButtonClass

getButtonClass() : string

Response

string

getForm

getForm() : string

Response

string

getFormValidation

getFormValidation() : bool

Response

bool

getIcon

getIcon() : string

Response

string

getLayout

Get layout path.

getLayout() : string
since

4.0.0

Response

string

getListCheck

getListCheck() : bool

Response

bool

getListCheckMessage

getListCheckMessage() : string

Response

string

getName

Get button name.

getName() : string
since

4.0.0

Response

string

getOnclick

getOnclick() : string

Response

string

getOption

Get single option value.

getOption(string name, mixed default = null) : mixed
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() : array
since

4.0.0

Response

array

getParent

Get parent toolbar instance.

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

4.0.0

Response

\Joomla\CMS\Toolbar\Toolbar

getTask

getTask() : string

Response

string

getText

getText() : string

Response

string

icon

icon(string value) : self

Arguments

value

string

Response

self

layout

Set layout path.

layout(string layout) : static
since

4.0.0

Arguments

layout

stringThe layout path name to render.

Response

staticReturn self to support chaining.

listCheck

listCheck(bool value) : self

Arguments

value

bool

Response

self

listCheckMessage

listCheckMessage(string value) : self

Arguments

value

string

Response

self

name

Set button name.

name(string name) : static
since

4.0.0

Arguments

name

stringThe button name.

Response

staticReturn self to support chaining.

onclick

onclick(array value) : self

Arguments

value

array

Response

self

prepareOptions

Prepare options for this button.

prepareOptions(array &options) : void
since

4.0.0

Arguments

options

arrayThe options about this button.

render

Get the HTML to render the button

render(array &definition = null) : string
since

3.0

throws

\Exception

Arguments

definition

arrayParameters to be passed

Response

string

renderButton

Render button HTML.

renderButton(array &options) : string
since

4.0.0

Arguments

options

arrayThe button options.

Response

stringThe button HTML.

setOption

Set option value.

setOption(string name, mixed value) : static
since

4.0.0

Arguments

name

stringThe option name to store value.

value

mixedThe option value.

Response

static

setOptions

Set all options.

setOptions(array options) : static
since

4.0.0

Arguments

options

arrayThe button options.

Response

staticReturn self to support chaining.

setParent

Set parent Toolbar instance.

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

4.0.0

Arguments

parent

\Joomla\CMS\Toolbar\ToolbarThe parent Toolbar instance to set.

Response

staticReturn self to support chaining.

task

task(string value) : self

Arguments

value

string

Response

self

text

text(string value) : self

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

idCounter

Used to track an ids, to avoid duplication

static
since

4.0.0

Type(s)

array