On Feb 3, 2008 7:13 AM, cronet <[EMAIL PROTECTED]> wrote: > > Hello, > > > how realising case by case validation ?? (e.g. A form need to validate > different for a user logged in, or not logged in) > > First, I thought about creating two different Models with the > different validation cases. > But what about the funcitons I need for the models which I would pack > in the model itselfs. So I would need to create the same functions in > both models... Not really DRY... > In app_model these functions would be available in all models, which i > don't prefer... > > What would be a more elegant way to handle case by case validations ? >
Create validation methods in your model and pass the name of those to your validation rules. In the method(s) you can check if the user is logged-in or not. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---