Back to Toolbar class

Method loadButtonType

public false|\Joomla\CMS\Toolbar\ToolbarButton
loadButtonType
(mixed $type, mixed $new = false)
Loads a button type.
Parameters
  • string $type Button Type
  • bool $new False by default
Returns
  • false|\Joomla\CMS\Toolbar\ToolbarButton
Since
  • 1.5
Class: Toolbar
Project: Joomla

Method loadButtonType - Source code

/**
 * Loads a button type.
 *
 * @param   string   $type  Button Type
 * @param   boolean  $new   False by default
 *
 * @return  false|ToolbarButton
 *
 * @since   1.5
 */
public function loadButtonType($type, $new = false)
{
    // For B/C, catch the exceptions thrown by the factory
    try {
        return $this->factory->createButton($this, $type);
    } catch (\InvalidArgumentException $e) {
        Log::add($e->getMessage(), Log::WARNING, 'jerror');
        return false;
    }
}