Piwik\Widget\WidgetConfig::setMiddlewareParameters PHP Method

setMiddlewareParameters() public method

- This way the inital page load time is faster as we won't have to request archived data on the initial page load for widgets that are potentially never shown. - We execute that action every time before showing it. As the initial list of widgets is loaded on page load it is possible that some archives have no data yet, but at a later time there might be actually archived data. As we never reload the initial list of widgets we would still not show the widget even there we should. Example: On page load there are no conversions, a few minutes later there might be conversions. As the middleware is executed before showing it, we detect correctly that there are now conversions whereas isEnabled is only checked once on the initial Piwik page load.
public setMiddlewareParameters ( array $parameters ) : static
$parameters array URL parameters eg array('module' => 'Goals', 'action' => 'Conversions')
return static
    public function setMiddlewareParameters($parameters)
    {
        $this->middlewareParameters = $parameters;
        return $this;
    }