Piwik\Plugin\Menu::urlForModuleActionWithDefaultUserParams PHP Метод

urlForModuleActionWithDefaultUserParams() защищенный Метод

Generates a URL to the given action of the given module, and it will also append some URL query parameters from the User preferences: idSite, period, date. If you do not need the parameters idSite, period and date to be generated use {@link urlForModuleAction()} instead.
protected urlForModuleActionWithDefaultUserParams ( string $module, string $controllerAction, array $additionalParams = [] ) : array | null
$module string The name of the module/plugin the action belongs to. The module name is case sensitive.
$controllerAction string The name of the action that should be executed within your controller
$additionalParams array Optional URL parameters that will be appended to the URL
Результат array | null Returns the array of query parameter names and values to the given module action and idSite date and period. Returns null if the module or action is invalid.
    protected function urlForModuleActionWithDefaultUserParams($module, $controllerAction, $additionalParams = array())
    {
        $urlModuleAction = $this->urlForModuleAction($module, $controllerAction);
        $date = Common::getRequestVar('date', false);
        if ($date) {
            $urlModuleAction['date'] = $date;
        }
        $period = Common::getRequestVar('period', false);
        if ($period) {
            $urlModuleAction['period'] = $period;
        }
        // We want the current query parameters to override the user's defaults
        return array_merge($this->urlForDefaultUserParams(), $urlModuleAction, $additionalParams);
    }