The Yaf_Route_Interface class

Introduction

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

Yaf_Route_Interface
class Yaf_Route_Interface {
/* Methods */
abstract public string assemble(array $info, array $query = ?)
abstract public bool route(Yaf_Request_Abstract $request)
}
Table of Contents