Back to CoreButtonsTrait class

Method back

public \Joomla\CMS\Toolbar\Button\LinkButton
back
(string $text = 'JTOOLBAR_BACK')
Writes a cancel button that will go back to the previous page without doing any other operation.
Parameters
  • string $text The text of button.
Returns
  • \Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0

Method back - Source code

/**
 * Writes a cancel button that will go back to the previous page without doing
 * any other operation.
 *
 * @param   string  $text  The text of button.
 *
 * @return  LinkButton
 *
 * @since   4.0.0
 */
public function back(string $text = 'JTOOLBAR_BACK') : LinkButton
{
    return $this->link('back', $text)->url('javascript:history.back();');
}