public \Joomla\CMS\Toolbar\ToolbarButton
__call
(mixed $name, mixed $args)
/**
* Magic method proxy.
*
* @param string $name The method name.
* @param array $args The method arguments.
*
* @return ToolbarButton
*
* @throws \Exception
*
* @since 4.0.0
*/
public function __call($name, $args)
{
if (strtolower(substr($name, -6)) === 'button') {
$type = substr($name, 0, -6);
$button = $this->factory->createButton($this, $type);
$button->name($args[0] ?? '')->text($args[1] ?? '')->task($args[2] ?? '');
return $this->appendButton($button);
}
throw new \BadMethodCallException(sprintf('Method %s() not found in class: %s', $name, static::class));
}