php8.5
Home/ Manual/ reference / yaf/ The Yaf_Route_Map class

The Yaf_Route_Map class

Yaf_Route_Map is a built-in route that converts the whole URI endpoint (that part of the URI which comes after the base URI: see Yaf_Request_Abstract::setBaseUri) into a single controller name or action name, depending on the first argument passed to Yaf_Route_Map::__construct. The path segments are joined with underscores:

Intro

Yaf_Route_Map is a built-in route that converts the whole URI endpoint (that part of the URI which comes after the base URI: see Yaf_Request_Abstract::setBaseUri) into a single controller name or action name, depending on the first argument passed to Yaf_Route_Map::__construct. The path segments are joined with underscores:

  • A => A
  • A/B/C => A_B_C
  • A/B/C/D/E => A_B_C_D_E

When the mapping goes to a controller name, its first letter is uppercased.

If the second argument of Yaf_Route_Map::__construct is specified, only the part of the URI before the delimiter is used for routing, while the part after it is parsed as request parameters (see the example section of Yaf_Route_Map::__construct).

Class synopsis

class Yaf_Route_Map { }

Properties

_ctl_router
_delimiter

Yaf-route-map

Source: reference/yaf/yaf-route-map.xml · from the official PHP manual (php/doc-en)