public function uri($className, $params = array())
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        if (!isset($this->resources[$className])) {
            throw new \Exception('Resource class "'.$className.'" not found');
        }
        if ($params && !is_array($params)) {
            $params = array($params);
        }
        foreach ($this->resources[$className]->getUri() as $index => $uri) {
            if (count($params) == count($this->resources[$className]->getUriParams($index))) {
                $parts = explode('([^/]+)', $uri);
                $path = '';
                foreach ($parts as $key => $part) {
                    $path .= $part;
                    if (isset($params[$key])) {
                        $path .= $params[$key];
                    }
                }
                return $this->baseUri.$path;
            }
        }
    }
public function uri($className, $params = array())
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        if (!isset($this->resources[$className])) {
            throw new \Exception('Resource class "'.$className.'" not found');
        }
        if ($params && !is_array($params)) {
            $params = array($params);
        }
        foreach ($this->resources[$className]->getUri() as $index => $uri) {
            if (count($params) == count($this->resources[$className]->getUriParams($index))) {
                $parts = explode('([^/]+)', $uri);
                $path = '';
                foreach ($parts as $key => $part) {
                    $path .= $part;
                    if (isset($params[$key])) {
                        $path .= $params[$key];
                    }
                }
                return $this->baseUri.$path;
            }
        }
    }
public function uri ( $ className , $ params = array ( ) ) { if ( is_object ( $ className ) ) { $ className = get_class ( $ className ) ; } if ( ! isset ( $ this -> resources [ $ className ] ) ) { throw new \ Exception ( 'Resource class "' . $ className . '" not found' ) ; } if ( $ params && ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } foreach ( $ this -> resources [ $ className ] -> getUri ( ) as $ index => $ uri ) { if ( count ( $ params ) == count ( $ this -> resources [ $ className ] -> getUriParams ( $ index ) ) ) { $ parts = explode ( '([^/]+)' , $ uri ) ; $ path = '' ; foreach ( $ parts as $ key => $ part ) { $ path .= $ part ; if ( isset ( $ params [ $ key ] ) ) { $ path .= $ params [ $ key ] ; } } return $ this -> baseUri . $ path ; } } }
Get the URL for the given resource class

@param  str   $className
@param  str[] $params
@return str
Get the URL for the given resource class