interface Route_Interface (View source)

\Yaf\Route_Interface used for developer defined their custom route.

Methods

bool
route(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 $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.

Details

bool route(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.

Parameters

Request_Abstract $request

Return Value

bool

bool assemble(array $info, array $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.

Parameters

array $info
array $query

Return Value

bool