Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 检查是否存在post参数_Magento_Magento 1.7 - Fatal编程技术网

Magento 检查是否存在post参数

Magento 检查是否存在post参数,magento,magento-1.7,Magento,Magento 1.7,我目前正在使用Magento控制器来处理post请求 我可以检查请求是否为POST并提取参数,但我想知道是否有标准方法来检查请求期间是否传递了特定参数 你会怎么做 $email = $this->getRequest()->getPost('email'); 或 同样的事情。Null,但是您可以通过第二个参数来规则这个值:$email=$this->getRequest()->getPost('email',false); $email = isset($_POST['email'

我目前正在使用Magento控制器来处理post请求

我可以检查请求是否为POST并提取参数,但我想知道是否有标准方法来检查请求期间是否传递了特定参数

你会怎么做

$email = $this->getRequest()->getPost('email');


同样的事情。

Null,但是您可以通过第二个参数来规则这个值:$email=$this->getRequest()->getPost('email',false);
$email = isset($_POST['email']) ? $_POST['email'] : null;