Back to PopupButton class

Method _getCommand

private string
_getCommand
(mixed $url)
Get the JavaScript command for the button
Parameters
  • string $url URL for popup
Returns
  • string JavaScript command string
Since
  • 3.0
Class: PopupButton
Project: Joomla

Method _getCommand - Source code

/**
 * Get the JavaScript command for the button
 *
 * @param   string  $url  URL for popup
 *
 * @return  string  JavaScript command string
 *
 * @since   3.0
 */
private function _getCommand($url)
{
    $url = $url ?? '';
    if (strpos($url, 'http') !== 0) {
        $url = Uri::base() . $url;
    }
    return $url;
}