Piwik\FrontController::fetchDispatch PHP Method

fetchDispatch() public method

_Note: If the plugin controller returns something, the return value is returned instead of whatever is in the output buffer._
Deprecation:
public fetchDispatch ( string $module = null, string $actionName = null, array $parameters = null ) : string
$module string The name of the plugin whose controller to execute, eg, `'UserCountryMap'`.
$actionName string The controller action name, eg, `'realtimeMap'`.
$parameters array Array of parameters to pass to the controller action method.
return string The `echo`'d data or the return value of the controller action.
    public function fetchDispatch($module = null, $actionName = null, $parameters = null)
    {
        ob_start();
        $output = $this->dispatch($module, $actionName, $parameters);
        // if nothing returned we try to load something that was printed on the screen
        if (empty($output)) {
            $output = ob_get_contents();
        } else {
            // if something was returned, flush output buffer as it is meant to be written to the screen
            ob_flush();
        }
        ob_end_clean();
        return $output;
    }