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

The Yaf_Route_Interface class

Yaf_Route_Interface defines the contract every route must implement: Yaf_Route_Interface::route, which inspects the request and claims it by setting the module, controller and action (and optionally request parameters), and Yaf_Route_Interface::assemble, which builds a URL from route info.

Intro

Yaf_Route_Interface defines the contract every route must implement: Yaf_Route_Interface::route, which inspects the request and claims it by setting the module, controller and action (and optionally request parameters), and Yaf_Route_Interface::assemble, which builds a URL from route info.

Implement this interface to define a custom route, and register it on the router with Yaf_Router::addRoute. The built-in route classes (Yaf_Route_Static, Yaf_Route_Simple, Yaf_Route_Supervar, Yaf_Route_Rewrite, Yaf_Route_Regex and Yaf_Route_Map) all implement it.

Class synopsis

class Yaf_Route_Interface { }

Yaf-route-interface

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