Skip to content

forms retrieving

Harmen Janssen edited this page Aug 22, 2016 · 2 revisions

Retrieving form data

After the form is submitted, you can see if the input is valid and retrieve the values, like so:

if ($this->getRequest()->isPost()) {
	if ($form->isValid($this->getRequest()->getPost())) {
		$values = $form->getValues();
		// … do something …
	}
}

isValid() should contain the post data.

Note that the isValid() call automatically adds error messages to the form, if any. It will also write the submitted values back to the input fields.

Fetching individual elements

You can also fetch individual elements.

Back to forms

Clone this wiki locally