I have a form after validation if any error occur the page will redirected to the edit itself with an error message.How to pass previous data and an error message through redirect() in typo3 ?
$this->redirect($action_name,$controllername, $extensionName, array('data',$data));
The arguments to pass to the redirect-target have to be given as associative array. The key is the argument name (as in the actions method header, without the
$), the value is the argument value. Looks like this:
$this->redirect( $action_name, $controllername, $extensionName, [ 'data' => $data ] );
$data is encoded in the URL depends on its type. Persistent objects are encoded as their ID, scalars are encoded as simple strings. How they arrive in the other action depends on that actions typehints and
To redirect to the same controller or extension, you can set those two values to