final class Yaf_Route_Simple implements Yaf_Route_Interface (View source)

Yaf_Route_Simple will match the query string, and find the route info.


all you need to do is tell Yaf_Route_Simple what key in the $_GET is module, what key is controller, and what key is action.


Yaf_Route_Simple::route() will always return TRUE, so it is important put Yaf_Route_Simple in the front of the Route stack, otherwise all the other routes will not be called

Properties

protected string $controller
protected string $module
protected string $action

Methods

__construct(string $module_name, string $controller_name, string $action_name)

Yaf_Route_Simple will get route info from query string. and the parameters of this constructor will used as keys while searching for the route info in $_GET.

bool
route(Yaf_Request_Abstract $request)

see Yaf_Route_Simple::__construct()

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

Yaf_Route_Simple::assemble() - Assemble a url

Details

__construct(string $module_name, string $controller_name, string $action_name)

Yaf_Route_Simple will get route info from query string. and the parameters of this constructor will used as keys while searching for the route info in $_GET.

Parameters

string $module_name
string $controller_name
string $action_name

Exceptions

Yaf_Exception_TypeError

bool route(Yaf_Request_Abstract $request)

see Yaf_Route_Simple::__construct()

Parameters

Yaf_Request_Abstract $request

Return Value

bool

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

Yaf_Route_Simple::assemble() - Assemble a url

Parameters

array $info
array|null $query

Return Value

bool