简体   繁体   English

如何知道Magento中的帖子键?

[英]How to know the keys of post in Magento?

I went through this tutorial: http://www.smashingmagazine.com/2014/03/13/tutorial-create-admin-manageable-magento-entity-brands/ . 我阅读了本教程: http : //www.smashingmagazine.com/2014/03/13/tutorial-create-admin-manageable-magento-entity-brands/

When accessing the post data, the author uses: 访问帖子数据时,作者使用:

 $this->getRequest()->getPost('brandData')

I am wondering how can we know there is a brandData key in the post data? 我想知道我们如何知道帖子数据中有brandData键?


NOTE: I know I can see the available keys using the 注意:我知道我可以使用

var_dump($this->getRequest()->getPost())

But I want to know how to know it without manually print the whole post data. 但是我想知道如何在不手动打印整个帖子数据的情况下知道它。

The available fields all yield from html form elements whose values have been sent to the controller that then works with the post data. 所有可用字段均来自html表单元素,其值已发送至控制器,然后该控制器可处理发布数据。

So there probably is a code snippet similar to this one 所以可能有一个与此类似的代码片段

<form method="post" action="/path/to/your/controllerAction">
    <input type="text" name="brandData" value="Default value" />
</form>

on the page used to send data to your controller. 在用于向控制器发送数据的页面上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM