Back to CoreButtonsTrait class

Method preferences

public \Joomla\CMS\Toolbar\Button\LinkButton
preferences
(string $component, string $text = 'JTOOLBAR_OPTIONS', string $path = '')
Writes a configuration button and invokes a cancel operation (eg a checkin).
Parameters
  • string $component The name of the component, eg, com_content.
  • string $text The text of this button.
  • string $path An alternative path for the configuration xml relative to JPATH_SITE.
Returns
  • \Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0

Method preferences - Source code

/**
 * Writes a configuration button and invokes a cancel operation (eg a checkin).
 *
 * @param   string  $component  The name of the component, eg, com_content.
 * @param   string  $text       The text of this button.
 * @param   string  $path       An alternative path for the configuration xml relative to JPATH_SITE.
 *
 * @return  LinkButton
 *
 * @since   4.0.0
 */
public function preferences(string $component, string $text = 'JTOOLBAR_OPTIONS', string $path = '') : LinkButton
{
    $component = urlencode($component);
    $path = urlencode($path);
    $uri = (string) Uri::getInstance();
    $return = urlencode(base64_encode($uri));
    return $this->linkButton('options', $text)->url('index.php?option=com_config&view=component&component=' . $component . '&path=' . $path . '&return=' . $return);
}