Back to ToolbarButton class

Method __construct

public
__construct
(string $name = '', string $text = '', array $options = [])
Init this class.
Parameters
  • string $name Name of this button.
  • string $text The button text, will auto translate.
  • array $options Button options.
Since
  • 4.0.0
-
  • \InvalidArgumentException
Class: ToolbarButton
Project: Joomla

Method __construct - Source code

/**
 * Init this class.
 *
 * @param   string  $name     Name of this button.
 * @param   string  $text     The button text, will auto translate.
 * @param   array   $options  Button options.
 *
 * @since  4.0.0
 *
 * @throws \InvalidArgumentException
 */
public function __construct(string $name = '', string $text = '', array $options = [])
{
    $this->name($name)->text($text);
    $this->options = ArrayHelper::mergeRecursive($this->options, $options);
}