本文介绍了从 SonataAdmin 中的表单访问 POST 数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的问题,如何在 sonataAdmin 中访问表单返回的原始 POST 数据?
I have a simple question, how can I access the raw POST data returned by a form in sonataAdmin?
我有一个使用 Javascript 创建表单的页面,我需要检索这些表单中的数据.问题是这些表单不是实体的属性,所以我不能让 Sonata 管理员为我自动链接它们.
I have a page that is creating forms using Javascript and I need to retrieve the data in those forms. The problem is that those forms are not attributes of the entity so I can't have Sonata admin linking them automatically for me.
推荐答案基础管理类提供了一个 getRequest 方法,该方法返回 Request 对象.
The base admin class provides a getRequest method which returns the Request object.
有点像……
$request = $this->getRequest(); $postValue = $request->request->get('parameterName');更多推荐
从 SonataAdmin 中的表单访问 POST 数据
发布评论