[TYPO3-mvc] Own Object Validator

Gianluca Strafella gianluca.strafella at webformat.com
Fri Nov 15 09:15:31 CET 2013


Hi Stefan,
a possibility can be this:

when you add error with method "$this->addError", you can specify as 
message, a unique key (a css class name ?), in example:

$this->addError('css-your-unique-classname', 84647862842);

in partial "FormErrors.html", instead you print the error message in 
"standard mode", you can assign css class to html element that is the 
container of error, and translate the key  'css-your-unique-classname' 
with an error message, in the locallang.xliff of your extention, in example:

<trans-unit id="css-your-unique-classname">
      <source>This is an error message</source>
</trans-unit>

Maybe ? I don't know others solutions ...

Regards,
Gianluca

Gianluca Strafella

Software Developer
gianluca.strafella at webformat.com
Tel.   +39-0427-926.389

WEBFORMAT srl – www.webformat.com
Via Mecenate, 76 - 20138 MILANO
Corte Europa, 12 - 33097 SPILIMBERGO (PN)


Il 14/11/2013 08:46, Stefan Kruse ha scritto:
> Hi Gianluca and all other,
>
> Thanks for reply and yes you are right but I need to set errors for
> properties.
>
> With " $this->addError(...) " theres no way to add an error class to the
> form field.
>
> So, I think the only way to visualize the form field error is to set an
> property error.
>
> But how is the best way to set property errors in my own object validator?
>
> Thanks  Stefan
>


More information about the TYPO3-project-typo3v4mvc mailing list