Add request parameter to request

后端 未结 1 495
我寻月下人不归
我寻月下人不归 2021-02-05 05:26

I need to put a flag in an kernel.event_listener at stage kernel.controller in order to do something in an kernel.response-listener.

1条回答
  •  不知归路
    2021-02-05 05:55

    You can use $request->attributes to pass around information. In your controller listener:

    $request->attributes->set('mykey', 'myvalue');
    

    In your response listener:

    $myvalue = $request->attributes->get('mykey');
    

    0 讨论(0)
提交回复
热议问题