Back to ToolbarHelper class

Method back

public static void
back
(mixed $alt = 'JTOOLBAR_BACK', mixed $href = 'javascript:history.back();')
Writes a cancel button that will go back to the previous page without doing any other operation.
Parameters
  • string $alt Alternative text.
  • string $href URL of the href attribute.
Returns
  • void
Since
  • 1.5
Class: ToolbarHelper
Project: Joomla

Method back - Source code

/**
 * Writes a cancel button that will go back to the previous page without doing
 * any other operation.
 *
 * @param   string  $alt   Alternative text.
 * @param   string  $href  URL of the href attribute.
 *
 * @return  void
 *
 * @since   1.5
 */
public static function back($alt = 'JTOOLBAR_BACK', $href = 'javascript:history.back();')
{
    $bar = Toolbar::getInstance('toolbar');
    // Add a back button.
    $arrow = Factory::getLanguage()->isRtl() ? 'arrow-right' : 'arrow-left';
    $bar->appendButton('Link', $arrow, $alt, $href);
}