Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Collect all post data at once


I might be missing something in the docs, but is there a way to collect all Post data objects at once?

Right now, I get the Post data on a request like this:

$test->user = $this->request->getPost("user", "striptags");

Thanks for the help so far, Soda

edited Aug '14

You can do it by this:

$all_post_data = $this->request->getPost(); // do not specify any arguments

It is described here

Unfortunetely I don't know how to get whole post array with filtering at the same time. Maybe this will work $this->request->getPost(null,"someFilter");?

edited Aug '14

You could just create your form using the Forms Builder and add filtering/validation logic there as well: you can then validate your form against the submitted post request using $form->isValid($this->request->getPost())