略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Route_Simple::__construct

2024-05-02

Yaf_Route_Simple::__construct

(Yaf >=1.0.0)

Yaf_Route_Simple::__constructYaf_Route_Simple constructor

说明

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

Yaf_Route_Simple将从query string中获得路由信息。这个构造函数的参数会被作为键到$_GET中去寻找路由信息。

警告

本函数还未编写文档,仅有参数列表。

参数

module_name

module信息的键名。

controller_name

controller信息的键名。

action_name

action信息的键名。

返回值

总是返回TRUE

范例

示例 #1 Yaf_Route_Simple::route()example

<?php
   $route 
= new Yaf_Route_Simple("m""controller""act");
   
Yaf_Router::getInstance()->addRoute("simple"$route);
?>

示例 #2 Yaf_Route_Simple::route()example

Request: http://yourdomain.com/path/?controller=a&act=b
=> module = default(index), controller = a, action = b

Request: http://yourdomain.com/path
=> module = default(index), controller = default(index), action = default(index)

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/yaf-route-simple.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3