0
使用ini文件配置Zend(1.12)表單時,我遇到了嘗試覆蓋默認電子郵件的問題。這個配置是這樣的:使用配置時無法覆蓋默認的Zend電子郵件錯誤消息
elements.emailAddress.type = email
elements.emailAddress.options.label = "Email Address"
elements.emailAddress.options.required = true
elements.emailAddress.options.maxlength = 255
elements.emailAddress.options.validators.required.validator = NotEmpty
elements.emailAddress.options.validators.required.options.messages.isEmpty = "An email address is required"
elements.emailAddress.options.validators.email.validator = EmailAddress
elements.emailAddress.options.validators.email.options.messages.emailAddressInvalidFormat = "Please enter a valid email address"
...
雖然我能夠以這種方式來覆蓋isEmpty
消息,該消息emailAddressInvalidFormat
保持默認"'xxx' is not a valid email address in the basic format [email protected]"
歡迎來到SO!請發佈您的編輯作爲答案,並接受它,而不是將其附加到您的問題。 – LeonardBlunderbuss
當系統讓我時,會這樣做。 – AndFisher