src/Controller.php
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;
    }
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;
    }
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 ; }
Get the routed request attributes

@param null|string $name
@param mixed       $default

@return mixed
Get the routed request attributes