Piwik\Plugin\Controller::getUrlSparkline PHP Method

getUrlSparkline() protected method

The result of this URL should be used with the sparkline() twig function. The current site ID and period will be used.
protected getUrlSparkline ( string $action, array $customParameters = [] ) : string
$action string Method name of the controller that serves the report.
$customParameters array The array of query parameter name/value pairs that should be set in result URL.
return string The generated URL.
    protected function getUrlSparkline($action, $customParameters = array())
    {
        $params = $this->getGraphParamsModified(array('viewDataTable' => 'sparkline', 'action' => $action, 'module' => $this->pluginName) + $customParameters);
        // convert array values to comma separated
        foreach ($params as &$value) {
            if (is_array($value)) {
                $value = rawurlencode(implode(',', $value));
            }
        }
        $url = Url::getCurrentQueryStringWithParametersModified($params);
        return $url;
    }