[TYPO3-mvc] Better Error Messages?
Patrick Schriner
patrick.schriner at diemedialen.de
Mon Jan 28 14:07:56 CET 2013
My usual pattern is to encapsulate the message in several <f:translate>
viewhelpers, with a fallback.
e.g
<f:if condition="{error.errors}">
<f:for each="{error.errors}" as="errorDetail">
<li>
<f:translate
key="validation.{error.propertyName}.{errorDetail.propertyName}.{errorDetail.errors.0.code}">
<f:translate
key="validation.{error.propertyName}.{errorDetail.errors.0.code}"
htmlEscape="false">
<f:translate
key="validation.{error.propertyName}.{errorDetail.propertyName}"
htmlEscape="false">validation.{error.propertyName}.{errorDetail.propertyName}</f:translate>
</f:translate>
</f:translate>
</li>
</f:for>
</f:if>
Patrick
On Mon, 28 Jan 2013 13:43:28 +0100, Stefan Kruse <besucher80 at gmx.de> wrote:
> Hi,
>
>
> i try to get some form error messages. I use the form error ViewHelper:
>
>
> <f:form.errors>
>
> <div class="error">
>
> {error.message}
>
> <f:if condition="{error.propertyName}">
>
> <p>
>
> <strong>{error.propertyName}</strong>:
>
> <f:for each="{error.errors}" as="errorDetail">
>
> <span>{errorDetail.message}</span>
>
> </f:for>
>
> </p>
>
> </f:if>
>
> </div>
>
> </f:form.errors>
>
>
> And get some messages like this:
>
>
> Validation errors for argument "notepadUser"
> notepadUser:
> Validation errors for property "username"
> Validation errors for property "password"
> Validation errors for property "newpassword"
> Validation errors for property "newpasswordrepeat"
>
>
> Is there a way to get my own message / maybe localized ? Or is this the
> maximum?
>
>
> Best regards Stefan
>
>
--
Patrick Schriner
More information about the TYPO3-project-typo3v4mvc
mailing list