Piwik\FrontController::dispatch PHP Method

dispatch() public method

Executes the requested plugin controller method.
public dispatch ( string $module = null, string $action = null, array $parameters = null ) : void | mixed
$module string The name of the plugin whose controller to execute, eg, `'UserCountryMap'`.
$action string The controller method name, eg, `'realtimeMap'`.
$parameters array Array of parameters to pass to the controller method.
return void | mixed The returned value of the call. This is the output of the controller method.
    public function dispatch($module = null, $action = null, $parameters = null)
    {
        if (self::$enableDispatch === false) {
            return;
        }
        $filter = new Router();
        $redirection = $filter->filterUrl(Url::getCurrentUrl());
        if ($redirection !== null) {
            Url::redirectToUrl($redirection);
            return;
        }
        try {
            $result = $this->doDispatch($module, $action, $parameters);
            return $result;
        } catch (NoAccessException $exception) {
            Log::debug($exception);
            /**
             * Triggered when a user with insufficient access permissions tries to view some resource.
             *
             * This event can be used to customize the error that occurs when a user is denied access
             * (for example, displaying an error message, redirecting to a page other than login, etc.).
             *
             * @param \Piwik\NoAccessException $exception The exception that was caught.
             */
            Piwik::postEvent('User.isNotAuthorized', array($exception), $pending = true);
        }
    }