Yaf_Route_Interface
interface Yaf_Route_Interface (View source)
Yaf_Route_Interface used for developer defined their custom route.
Methods
Yaf_Route_Interface::route() is the only method that a custom route should implement.
if this method return TRUE, then the route process will be end. otherwise, Yaf_Router will call next route in the route stack to route request.
This method would set the route result to the parameter request, by calling Yaf_Request_Abstract::setControllerName(), Yaf_Request_Abstract::setActionName() and Yaf_Request_Abstract::setModuleName().
This method should also call Yaf_Request_Abstract::setRouted() to make the request routed at last.
Yaf_Route_Interface::assemble() - assemble a request
this method returns a url according to the argument info, and append query strings to the url according to the argument query.
a route should implement this method according to its own route rules, and do a reverse progress.
Details
bool
route(Yaf_Request_Abstract $request)
Yaf_Route_Interface::route() is the only method that a custom route should implement.
if this method return TRUE, then the route process will be end. otherwise, Yaf_Router will call next route in the route stack to route request.
This method would set the route result to the parameter request, by calling Yaf_Request_Abstract::setControllerName(), Yaf_Request_Abstract::setActionName() and Yaf_Request_Abstract::setModuleName().
This method should also call Yaf_Request_Abstract::setRouted() to make the request routed at last.
bool
assemble(array $info, array|null $query = null)
Yaf_Route_Interface::assemble() - assemble a request
this method returns a url according to the argument info, and append query strings to the url according to the argument query.
a route should implement this method according to its own route rules, and do a reverse progress.