您当前的位置: 首页 >  中间件

Swoft2.x 参数获取 公共函数 注解路由以及中间件

苗先生的PHP记录 发布时间:2022-05-12 22:32:29 ,浏览量:7

首先新建一个任意名称的控制器文件, 我这里就叫Good.php了

公共函数

公共函数: 所有公共函数在 app\Helper\Functions.php

// 公共函数测试
function getsi(int $i ,string $b): stdClass
{
    $c =  new stdClass();
    {
        $c->id = $i;
        $c->body = $b;
    }
    return $c;
}
路由

手动注解 , 生成一个 http://xxx.com/goodlist 的路由 , 方法时Get

            
关注
打赏
1688896170
查看更多评论
0.1862s