Is there a method overwriting $_POST?
After checking if the request failed to pass validation, I want to use the filtered values as the form's values. Example:
$filteredValues = $this->validation->getValues();
$this->request->setPost($filteredValues);
You can use replace() or setData(), because request's post is an Arr.
$this->request->getPost()->replace($this->validation->getValues());
Remember that this not overwrite the _POST due to https://github.com/phalcon/zephir/issues/203, so after replace:
$_POST['username']; // still original
$this->request->getPost('username'); // filtered
Your advice was helpful. Thank you very much!!
Is it _POST overwriting required in the future? What do you think?
I thought that I need to use _POST overwriting, because Ice\Tag class use _POST.
The issue will probably be solved by the following example. What do you think?
$this->request->getPost()->replace($this->validation->getValues());
$this->tag->setValues($this->requrest->getPost());
Yes, you can set values:
$this->tag->setValues($this->requrest->getPost()->getData());