The Yaf_Router class

(Yaf >=1.0.0)

Introduzione

Yaf_Router is the standard framework router. Routing is
the process of taking a URI endpoint (that part of the URI which comes
after the base URI: see Yaf_Request_Abstract::setBaseUri())
and decomposing it into parameters to determine which module, controller, and
action of that controller should receive the request. This values of the module,
controller, action and other parameters are packaged into a
Yaf_Request_Abstract object which is then processed by
Yaf_Dispatcher. Routing occurs only once: when the request
is initially received and before the first controller is dispatched.
Yaf_Router is designed to allow for mod_rewrite-like
functionality using pure PHP structures. It is very loosely based on Ruby
on Rails routing and does not require any prior knowledge of webserver URL
rewriting. It is designed to work with a single Apache mod_rewrite rule
(one of):

Default route

Yaf_Router comes preconfigured with a default route
Yaf_Route_Static, which will match URIs in the shape of
controller/action. Additionally, a module name may be specified as the first
path element, allowing URIs of the form module/controller/action. Finally,
it will also match any additional parameters appended to the URI by default
- controller/action/var1/value1/var2/value2.

Nota:

Module name must be defined in config, considering application.module="Index,Foo,Bar",
in this case, only index, foo and bar can be considerd as a module name.
if doesn't config, there is only one module named "Index".