private function isActive($route, $params, Request $request)
    {
        if ('/contao' === $request->getPathInfo()
            || !($request->attributes->get('_route') === $route)
        ) {
            return false;
        }

        $attributes = $request->attributes->get('_route_params');
        $query      = $request->query;
        foreach ($params as $param => $value) {
            if (isset($attributes[$param]) && ($value !== $request->attributes['_route_params'][$param])) {
                return false;
            }
            if ($query->has($param) && ($value !== $query->get($param))) {
                return false;
            }
        }

        return true;
    }