从 SonataAdmin 中的表单访问 POST 数据

编程入门 行业动态 更新时间:2024-10-24 11:16:59
本文介绍了从 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 数据

本文发布于:2023-10-09 18:35:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476459.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   数据   SonataAdmin   POST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!