Hallo,
ich habe folgendes Problem. Ich hab ein Formular, dazu ein Model und an jeder Property eine Validation-Annotation. Nun hängt aber eine Property von einer anderen ab, dazu hab ich die Validierung im Controller an die Action geschrieben. Nun will ich aber diese Fehlermeldung an das Property binden. Hat jemand einen Tipp, wie ich das anstelle?
Gruß, Sven
Hallo!
Ich binde die Fehler innerhalb der isValid()-Funktion eines Validators folgendermaßen:
$notEmptyValidator = new Tx_Extbase_Validation_Validator_NotEmptyValidator();
if (!($notEmptyValidator->isValid($theCart->getFirstName()))) {
$this->errors['firstName'] = new Tx_Extbase_Validation_PropertyError('firstName');
$this->errors['firstName']->addErrors(array(new Tx_Extbase_Validation_Error(Tx_Extbase_Utility_Localization::translate('error.firstName.empty', 'registration'), '1312448731')));
$success = false;
}
Vielleicht hilft Dir das weiter.
Viele Grüße,
Xandi
Hey Xandio,
funktioniert super, danke Dir.
Gruß, Sven