public function getRouteAttributes($name = null, $default = null)
    {
        /** @var Route $route */
        $route = $this->request->getAttribute('route', false);
        $attributes = $route
            ? $route->attributes
            : [];
        
        if (null == $name) {
            return $attributes;
        }
        
        return array_key_exists($name, $attributes)
            ? $attributes[$name]
            : $default;
    }