Back to ActionButton class

Method addState

public static
addState
(int $value, string $task, string $icon = 'ok', string $title = '', array $options = [])
Add a state profile.
Parameters
  • int $value The value of this state.
  • string $task The task you want to execute after click this button.
  • string $icon The icon to display for user.
  • string $title Title text will show if we enable tooltips.
  • array $options The button options, will override group options.
Returns
  • static Return self to support chaining.
Since
  • 4.0.0
Class: ActionButton
Project: Joomla

Method addState - Source code

/**
 * Add a state profile.
 *
 * @param   integer  $value    The value of this state.
 * @param   string   $task     The task you want to execute after click this button.
 * @param   string   $icon     The icon to display for user.
 * @param   string   $title    Title text will show if we enable tooltips.
 * @param   array    $options  The button options, will override group options.
 *
 * @return  static  Return self to support chaining.
 *
 * @since   4.0.0
 */
public function addState(int $value, string $task, string $icon = 'ok', string $title = '', array $options = []) : self
{
    // Force type to prevent null data
    $this->states[$value] = ['value' => $value, 'task' => $task, 'icon' => $icon, 'title' => $title, 'options' => $options];
    return $this;
}