Back to CoreButtonsTrait class

Method addNew

public \Joomla\CMS\Toolbar\Button\StandardButton
addNew
(string $task, string $text = 'JTOOLBAR_NEW')
Writes the common 'new' icon for the button bar.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0

Method addNew - Source code

/**
 * Writes the common 'new' icon for the button bar.
 *
 * @param   string  $task  The task name of this button.
 * @param   string  $text  The text of this button.
 *
 * @return  StandardButton
 *
 * @since   4.0.0
 */
public function addNew(string $task, string $text = 'JTOOLBAR_NEW') : StandardButton
{
    return $this->standardButton('new', $text)->task($task);
}