Skip to main content
setPost() request ParametersInterface as input, setPostValue() can be as you explained.
Source Link

Look how method Zend_Controller_Request_Http::getParams works:

public function getParams()
{
    $return       = $this->_params;
    $paramSources = $this->getParamSources();
    if (in_array('_GET', $paramSources)
        && isset($_GET)
        && is_array($_GET)
    ) {
        $return += $_GET;
    }
    if (in_array('_POST', $paramSources)
        && isset($_POST)
        && is_array($_POST)
    ) {
        $return += $_POST;
    }
    return $return;
}

It all time gets parameters from global array and doesn't store it in class properties.

So there are two options you have:

  • change $_POST strictly (eg if (isset($_POST['super_attribute'])) { unset($_POST['super_attribute']); } ).
  • or you can use $this->getRequest()->setPost>setPostValue('super_attribute', null). In that case key super_attribute wont be removed from $_POST array, but will be modified.

Look how method Zend_Controller_Request_Http::getParams works:

public function getParams()
{
    $return       = $this->_params;
    $paramSources = $this->getParamSources();
    if (in_array('_GET', $paramSources)
        && isset($_GET)
        && is_array($_GET)
    ) {
        $return += $_GET;
    }
    if (in_array('_POST', $paramSources)
        && isset($_POST)
        && is_array($_POST)
    ) {
        $return += $_POST;
    }
    return $return;
}

It all time gets parameters from global array and doesn't store it in class properties.

So there are two options you have:

  • change $_POST strictly (eg if (isset($_POST['super_attribute'])) { unset($_POST['super_attribute']); } )
  • or you can use $this->getRequest()->setPost('super_attribute', null). In that case key super_attribute wont be removed from $_POST array, but will be modified

Look how method Zend_Controller_Request_Http::getParams works:

public function getParams()
{
    $return       = $this->_params;
    $paramSources = $this->getParamSources();
    if (in_array('_GET', $paramSources)
        && isset($_GET)
        && is_array($_GET)
    ) {
        $return += $_GET;
    }
    if (in_array('_POST', $paramSources)
        && isset($_POST)
        && is_array($_POST)
    ) {
        $return += $_POST;
    }
    return $return;
}

It all time gets parameters from global array and doesn't store it in class properties.

So there are two options you have:

  • change $_POST strictly (eg if (isset($_POST['super_attribute'])) { unset($_POST['super_attribute']); } ).
  • or you can use $this->getRequest()->setPostValue('super_attribute', null). In that case key super_attribute wont be removed from $_POST array, but will be modified.
Source Link
alex_b
  • 716
  • 3
  • 8

Look how method Zend_Controller_Request_Http::getParams works:

public function getParams()
{
    $return       = $this->_params;
    $paramSources = $this->getParamSources();
    if (in_array('_GET', $paramSources)
        && isset($_GET)
        && is_array($_GET)
    ) {
        $return += $_GET;
    }
    if (in_array('_POST', $paramSources)
        && isset($_POST)
        && is_array($_POST)
    ) {
        $return += $_POST;
    }
    return $return;
}

It all time gets parameters from global array and doesn't store it in class properties.

So there are two options you have:

  • change $_POST strictly (eg if (isset($_POST['super_attribute'])) { unset($_POST['super_attribute']); } )
  • or you can use $this->getRequest()->setPost('super_attribute', null). In that case key super_attribute wont be removed from $_POST array, but will be modified