Download the PHP package corpus/router without Composer
On this page you can find all versions of the php package corpus/router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download corpus/router
More information about corpus/router
Files in corpus/router
Informations about the package router
Corpus Router
A Simple Collection of Routers
Requirements
- php: >=7.1
Installing
Install the latest version with:
Usage
HttpRouter
Documentation
Class: \Corpus\Router\HttpRouter
Method: HttpRouter->__construct
Parameters:
- array
$server
- The $_SERVER array - optional
Method: HttpRouter->match
Match given path to a route array.
A non-null route is not guaranteed to exist - just to be well formed.
It is up the implementations dispatch mechanism to decide it the route exists
The returned route array the the a shape of
Match given path to a route array.
A non-null route is not guaranteed to exist - just to be well formed.
It is up the implementations dispatch mechanism to decide it the route exists
The returned route array the the a shape of
Parameters:
- string
$path
- The path to match against including query string alafoo/bar.html?param=woo
Returns:
- array | null - route array or null on failure to route
Method: HttpRouter->generate
Generate a URL for the given controller, action and options
Parameters:
- object | string
$controller
- Instance or Relative 'admin\index' or absolute '\Controllers\www\admin\index'
Method: HttpRouter->getNamespace
Returns:
- string - The canonical namespace prefix
Class: \Corpus\Router\CliRouter
Method: CliRouter->__construct
Parameters:
- string
$rootNamespace
- The namespace prefix the controllers will be under
Method: CliRouter->match
Match given path to a route array.
A non-null route is not guaranteed to exist - just to be well formed.
It is up the implementations dispatch mechanism to decide it the route exists
The returned route array the the a shape of
Parameters:
- string
$path
- The path to match against including query string alafoo/bar.html?param=woo
Returns:
- array | null - route array or null on failure to route
Method: CliRouter->getNamespace
Returns:
- string - The canonical namespace prefix