[TYPO3-mvc] [Extbase] Calling errorAction() from other action
Claus Fassing
claus at fassing.eu
Thu Sep 16 18:19:52 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am 16.09.2010 11:37, schrieb Franz Koch:
> I noticed that extbase
> is not persisting flashMessages when redirecting
I guess no. The blog example add a flash message and redirect
(deleteAction, createAction) to index and the flash message appear.
Now I'm using an action Validator (Validation of controller argument).
There I add a message and return FALSE. This will raise the
errorAction() method which forward to the originating action. In this
action I have to use the following to get the message from Validator.
$errors = $this->request->getErrors();
if($errors){
foreach ($errors as $error){
foreach($error->getErrors() as $e){
$this->flashMessages->add($e->getMessage());
}
}
}
This can't be the right way, isn't it ?
The question is, are there any option to add an (error) message from
Validator into form.errors ?
Maybe the problem is in my case, that there is no field binding, cause I
use the f:form.upload. This is not representing by any object attribute.
Regards Claus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMkkOoAAoJELsIv+audObfS8QIALQOWl4pi4RRTqMlvBp5XsiY
llM82CBSw2imZDLEUhTJKqXBoE5V01CCy51R5amj1F/5Tn8DRJGgHUvs7bRzDPvD
mxSayyKC6DobxYduW3QPByt+vIiImsGiHKhPvAML+iVcQZysTqxFwp8UgsLdojZg
r/KR6kJbfmNHWfGQOE6A9eQg/vIjTWF5TPu/tyYUsfTwdSjuVQyp9WhGHunX7UDU
RD9xkOxS/6OYqshAsJxS49wttpcvKsUlEd7kYhKF+ffs70HWV7sYScypl64/iqFi
US4bIAZL5fHtL2+Mv2YUHfv3JJ+FvfMPFhENa1D7M+PKgS/2XevVsNqJbnUDwRk=
=YBjb
-----END PGP SIGNATURE-----
More information about the TYPO3-project-typo3v4mvc
mailing list