|
|
| <prev next> |
Choosing A Webhost: |
better msg handling in FormValidator ?: msg#00000lang.perl.modules.cgi-appplication
Hi, i am using C::A::P::ValidateRM and it has been great. one thing i don't like what i am doing is the way of organizing customized message for form error. currently i have something like this: constraint_methods => { a_field => sub { my ($dfv, $val) = @_; if $val matches html tag $dfv->name_is('html_tag_found'); return; } else { return 1 } } } msgs => { prefix => 'err_', any_errors => 'some_errors', constrains => { html_tag_found => 'html tag is not allowed in this field', } } a good thing about the above is that, i can use [% err_a_field %] in my template without conditionaly looking up what exact error it is. it is okay when i have only one or two forms. but it gets a bit out of hand to maintain the message system. i already have the real messages stored in a config file instead of hardcoded it in the module. also, it seems redundant to have 'html_tag_found' in the constraint_methods and in msgs. i am wondering how are other people using DFV and i would like to adopt a simpler and maintaintable way.. thanks, James. ____________________________________________________________________________________ Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Next by Date: | Re: better msg handling in FormValidator ?, Michael Peters |
|---|---|
| Next by Thread: | Re: better msg handling in FormValidator ?, Michael Peters |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |