Piwik\API\Request::getBaseReportUrl PHP Method

getBaseReportUrl() public static method

Returns the URL for the current requested report w/o any filter parameters.
public static getBaseReportUrl ( string $module, string $action, array $queryParams = [] ) : string
$module string The API module.
$action string The API action.
$queryParams array Query parameter overrides.
return string
    public static function getBaseReportUrl($module, $action, $queryParams = array())
    {
        $params = array_merge($queryParams, array('module' => $module, 'action' => $action));
        return Request::getCurrentUrlWithoutGenericFilters($params);
    }

Usage Example

Example #1
0
 /**
  * Adds a related report to the {@link $related_reports} property. If the report
  * references the one that is currently being displayed, it will not be added to the related
  * report list.
  *
  * @param string $relatedReport The plugin and method of the report, eg, `'DevicesDetection.getBrowsers'`.
  * @param string $title The report's display name, eg, `'Browsers'`.
  * @param array $queryParams Any extra query parameters to set in releated report's URL, eg,
  *                           `array('idGoal' => 'ecommerceOrder')`.
  */
 public function addRelatedReport($relatedReport, $title, $queryParams = array())
 {
     list($module, $action) = explode('.', $relatedReport);
     // don't add the related report if it references this report
     if ($this->controllerName == $module && $this->controllerAction == $action) {
         if (empty($queryParams)) {
             return;
         }
     }
     $url = ApiRequest::getBaseReportUrl($module, $action, $queryParams);
     $this->related_reports[$url] = $title;
 }
All Usage Examples Of Piwik\API\Request::getBaseReportUrl