final class Map implements Route_Interface (View source)

\Yaf\Route\Map is a built-in route, it simply convert a URI endpoint (that part of the URI which comes after the base URI: see \Yaf\Request_Abstract::setBaseUri()) to a controller name or action name(depends on the parameter passed to \Yaf\Route\Map::__construct()) in following rule: A => controller A. A/B/C => controller A_B_C. A/B/C/D/E => controller A_B_C_D_E.


If the second parameter of \Yaf\Route\Map::__construct() is specified, then only the part before delimiter of URI will used to routing, the part after it is used to routing request parameters (see the example section of \Yaf\Route\Map::__construct()).

Properties

protected string $_ctl_router
protected string $_delimiter

Methods

__construct(bool $controller_prefer = false, string $delimiter = '')

No description

bool
route(Request_Abstract $request)

No description

bool
assemble(array $info, array $query = null)

\Yaf\Route\Map::assemble() - Assemble a url

Details

__construct(bool $controller_prefer = false, string $delimiter = '')

No description

Parameters

bool $controller_prefer

Whether the result should considering as controller or action

string $delimiter

bool route(Request_Abstract $request)

No description

Parameters

Request_Abstract $request

Return Value

bool

bool assemble(array $info, array $query = null)

\Yaf\Route\Map::assemble() - Assemble a url

Parameters

array $info
array $query

Return Value

bool