2014-02-17 27 views
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]"

+0

歡迎來到SO!請發佈您的編輯作爲答案,並接受它,而不是將其附加到您的問題。 – LeonardBlunderbuss

+0

當系統讓我時,會這樣做。 – AndFisher

回答

0

假陰性!我正在使用擴展庫類來添加HTML5表單元素(如電子郵件),這些元素添加了自己的電子郵件驗證程序,該程序覆蓋了配置的驗證程序!

相關問題