Ouzo\Uri::getPathWithoutPrefix PHP Méthode

getPathWithoutPrefix() public méthode

    public function getPathWithoutPrefix()
    {
        $prefix = Config::getValue('global', 'prefix_system');
        $path = Strings::removePrefix($this->getPath(), $prefix);
        if (preg_match('#.+/$#', $path)) {
            $path = rtrim($path, '/');
        }
        return $path;
    }

Usage Example

Exemple #1
0
 /**
  * @return RouteRule
  * @throws RouterException
  */
 public function findRoute()
 {
     $path = $this->uri->getPathWithoutPrefix();
     $requestType = Uri::getRequestType();
     $rule = $this->findRouteRule($path, $requestType);
     if (!$rule) {
         throw new RouterException('No route rule found for HTTP method [' . $requestType . '] and URI [' . $path . ']');
     }
     $rule->setParameters($path);
     return $rule;
 }
All Usage Examples Of Ouzo\Uri::getPathWithoutPrefix