且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从 Symfony2 请求对象中删除单个参数

更新时间:2023-11-05 12:35:16

我不确定,如果您的调用 $request->request 是错字.

I am not sure, if your call $request->request is typo.

你应该使用 $request->attributes 操作,它代表 ParameterBag 类.

You should operate with $request->attributes which represents ParameterBag class.

如果您将通过 中的方法ParameterBag 你会看到没有办法在数组内取消设置变量.

If you'll go through methods in ParameterBag you'll see that there is no way to unset variable inside array.