/**
* Get the HTML to render the button
*
* @param array &$definition Parameters to be passed
*
* @return string
*
* @since 3.0
*
* @throws \Exception
*/
public function render(&$definition = null)
{
if ($definition === null) {
$action = $this->renderButton($this->options);
} elseif (\is_array($definition)) {
$action = $this->fetchButton(...$definition);
} else {
throw new \InvalidArgumentException('Wrong argument: $definition, should be NULL or array.');
}
// Build the HTML Button
$layout = new FileLayout('joomla.toolbar.base');
return $layout->render(['action' => $action, 'options' => $this->options]);
}