Regex
final class Regex extends Router implements Route_Interface (View source)
\Yaf\Route\Regex is the most flexible route among the Yaf built-in routes.
Properties
protected Route_Interface[] | $_routes | from Router | |
protected string | $_current | from Router | |
protected string | $_route | ||
protected array | $_default | ||
protected array | $_maps | ||
protected array | $_verify | ||
protected string | $_reverse |
Methods
No description
by default, \Yaf\Router using a \Yaf\Route_Static as its default route. you can add new routes into router's route stack by calling this method.
the newer route will be called before the older(route stack), and if the newer router return TRUE, the router process will be end. otherwise, the older one will be called.
Retrieve a route by name, see also \Yaf\Router::getCurrentRoute()
Get the name of the route which is effective in the route process.
Note:
You should call this method after the route process finished, since before that, this method will always return NULL.
\Yaf\Route\Regex::assemble() - Assemble a url
Details
__construct(string $match, array $route, array $map = null, array $verify = null, string $reverse = null)
No description
Router|false
addRoute(string $name, Route_Interface $route)
by default, \Yaf\Router using a \Yaf\Route_Static as its default route. you can add new routes into router's route stack by calling this method.
the newer route will be called before the older(route stack), and if the newer router return TRUE, the router process will be end. otherwise, the older one will be called.
Router|false
addConfig(Config_Abstract $config)
Add routes defined by configs into \Yaf\Router's route stack
Router|false
route(Request_Abstract $request)
Route a incoming request.
Route_Interface
getRoute(string $name)
Retrieve a route by name, see also \Yaf\Router::getCurrentRoute()
Route_Interface[]
getRoutes()
No description
string
getCurrentRoute()
Get the name of the route which is effective in the route process.
Note:
You should call this method after the route process finished, since before that, this method will always return NULL.
bool
assemble(array $info, array $query = null)
\Yaf\Route\Regex::assemble() - Assemble a url