The Yaf_Route_Simple class

The Yaf_Route_Simple class

(Yaf >=1.0.0)

簡介

Yaf_Route_Simple 會匹配請求中的query string,然後找到路由資訊。

你需要做的只是告訴 Yaf_Route_Simple,在$_GET中哪個是Module,哪個是Controller,哪個是Action。

Yaf_Route_Simple::route() 總是會返回TRUE,所以把Yaf_Route_Simple放在路由堆疊前面是很重要的,否則其他所有的路由都可能不會被呼叫到。

類摘要

class Yaf_Route_Simple implements Yaf_Route_Interface {
/* 屬性 */
protected $controller;
protected $module;
protected $action;
/* 方法 */
public assemble(array $info, array $query = ?): string
public__construct(string $module_name, string $controller_name, string $action_name)
public route(Yaf_Request_Abstract $request): bool
}

屬性

controller

module

action

目錄

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *