dongmei425373 2016-02-03 01:07
浏览 68
已采纳

Slim 3访问来自另一个类的响应/请求对象

I have a Utils class, I need to use $response/$request from Slim 3 to use some useful methods (ex: $request->getUri()->getPath()), how can I access to $request or $response like that:

class AppCore
{

    public static function AllowRoutePass($request, $response)
    {
        $reqMethod =$request->getUri()->getPath();
        if (in_array($reqMethod, AppConfig::IGNORE_ROUTES))
            return true;
        return false;
    }

}

Thank everyone!

  • 写回答

1条回答 默认 最新

  • duanhuihui2705 2016-02-08 00:37
    关注

    OK, i also create an question in Githup Slim repository here: Slim 3 access response/request object from another class.
    Currently there is no way to implement the util class I was described as above. Check out the link to see more informations. In my case, i must change my logics and implement my util class in another way.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器