Re: Dynamic Error Messages in 1.2?

2008-03-10 Thread grigri
Don't know if this will actually help or hinder nate in his efforts, but I made it work like this: http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2#1943 The basic principle is : define a magic constant to use in the $validation array to mean manual,

Re: Dynamic Error Messages in 1.2?

2008-03-09 Thread Mike
Having read John David Anderson (_psychic_)'s second post to http://groups.google.com/group/cake-php/browse_thread/thread/7acc2b07160366c2, I was wondering if it would be helpful if I put a proposed code change (including some unit tests) to do this. If this has been spec'd out at all, I'd be

Re: Dynamic Error Messages in 1.2?

2008-03-09 Thread nate
Well, I'm *sort of* in the middle of doing it, but if you could provide unit tests for it, that would be fantastically useful. Just open an enhancement ticket and attach the diff. If you can do that, I'll try and get to it sometime today. On Mar 9, 3:49 am, Mike [EMAIL PROTECTED] wrote:

Re: Dynamic Error Messages in 1.2?

2008-03-08 Thread nate
This will be implemented before the next release. On Mar 7, 8:26 pm, Mike [EMAIL PROTECTED] wrote: Thanks for your suggestion - I was thinking about that, and here's what I came up with.  If you can see any holes/offer any refinements, I'd love to hear about them :) Part of the reason I'm

Re: Dynamic Error Messages in 1.2?

2008-03-08 Thread Mike
Awesome!! Thank you very much! (I do understand that this decision was made independent of my questions about this feature, but I figure that it's a nice feature that I'm looking forwards to, and so saying 'Thanks' seems to be a good thing to do :) ) Thanks! --Mike On Mar 8, 6:42 am, nate

Re: Dynamic Error Messages in 1.2?

2008-03-07 Thread dr. Hannibal Lecter
Have you tried Model::invalidate(...)? http://api.cakephp.org/1.2/class_model.html#81c94997c2d6158c40efd9c7008f18a3 On Mar 6, 10:29 pm, Mike [EMAIL PROTECTED] wrote: Hello! In CakePHP 1.2, one can define a validation rule (in a model) that calls a method to do the validation. If the method

Re: Dynamic Error Messages in 1.2?

2008-03-07 Thread Mike
Thanks for the reply! One of the big reasons I went with Cake is that it seemed to have an active, friendly community. I'm glad to be part of it! :) I tried this out, and it doesn't seem to work. Looking at the code in cake/libs/model/model.php, specifically the invalidFields method, just

Re: Dynamic Error Messages in 1.2?

2008-03-07 Thread b logica
Why not just create a second validation method and narrow the first one to whatever concerns the message you've set for it? On Fri, Mar 7, 2008 at 6:46 PM, Mike [EMAIL PROTECTED] wrote: Thanks for the reply! One of the big reasons I went with Cake is that it seemed to have an active,

Re: Dynamic Error Messages in 1.2?

2008-03-07 Thread Mike
Thanks for your suggestion - I was thinking about that, and here's what I came up with. If you can see any holes/offer any refinements, I'd love to hear about them :) Part of the reason I'm against this is that I've already got a function that does what I want, and I'm looking to reuse it in

Re: Dynamic Error Messages in 1.2?

2008-03-07 Thread R. Rajesh Jeba Anbiah
On Mar 7, 2:29 am, Mike [EMAIL PROTECTED] wrote: In CakePHP 1.2, one can define a validation rule (in a model) that calls a method to do the validation. If the method returns false, then whatever message was specified for that rule is displayed in the view, which is great for most of data