milicic.marko wrote:

> I need to validte my model in that way to forbide inserting two posts
> with same Title.
> OK. This is not an REGEX type of validation so I suppose I must use
> some callback function.
> I used beforeSave() CB function and returned false if I detect that
> post with that title already exists.
> But, what I'm supposed to do in order to force cake to behave like it
> was an regex type validation failure...
> 
> I want to use  $html->tagErrorMsg to present error message....

I much prefer enforcing this sort of model-integrity issue in the 
database by using a UNIQUE index on the column in question.

This approach only works if what you're saying is true in all cases, of 
course.


Cheers,

Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to