Yo can use this as is, also could be useful to put that in AppModel.
MultivalidateModel is a (bad) example name, sorry.


On Wed, Feb 13, 2008 at 11:13 PM, Siebren Bakker
<[EMAIL PROTECTED]> wrote:
> @Dardo
> that looks perfect for what I need, just one quick question. Can I just use
> it in my User model, or do I need to create a multiValidate model, and if
> so, what would be the naming convention on that?
>
>
>
>  On Feb 8, 2008 4:16 AM, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > You can set different set of rules on your model:
> >
> > Class MultivalidateModel extends AppModel {
> >
> >  var $name = 'Multivalidate';
> >
> >  var $validationSets = array(
> >                                          'default' => ... default rules,
> >                                          'state1' => ... full validate
> array1,
> >                                          'state2' => ... full validate
> array2,
> >        );
> >
> >   var $currentRuleSet = 'default';
> >
> >  function validates ($data =array())
> >  {
> >       $this->validate = $this->$validationSets[$this->currentRuleSet];
> >       parent::validates($data);
> >  }
> >
> >
> > }
> >
> > }
> >
> >
> > Also this can be put on a behavior.
> >
> >
> >
> > On Feb 7, 2008 2:25 PM, Siebren Bakker <[EMAIL PROTECTED]> wrote:
> > > I don't actually need to compare the information with that from the
> > > database, I just need to  validate the data in the fields, preferably
> using
> > > the $validate array present in my User Model, in order to make sure that
> it
> > > is valid data for those fields, without having to add validation data to
> the
> > > controller
> > >
> > >
> > > On Feb 6, 2008 10:18 PM, Rgarg <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > do you want to cum pair  user written data with database??
> > > >
> > >
> > >
> > >
> > > --
> >
> > > In the name of Life, Liberty, and the pursuit of my sanity.
> > > Siebren Bakker(Aevum Decessus)
> > > -----BEGIN GEEK CODE BLOCK-----
> > > Version: 3.12
> > > GCS d- s+: a19 C++++ UL++ P L++
> > >  !E W++ N(-) o? K? w(+) O? M-- V?
> > > PS+ PE Y- PGP- t+ 5? X- R tv--
> > > b++ Di D+ G+ e h! r y-
> > > ------END GEEK CODE BLOCK------
> > >  >
> > >
> >
> >
> >
> >
> > Version: 3.12
> > GCS d- s+: a20 C++++ UL++ P L++
> >
> > !E W++ N(-) o? K? w(+) O? M-- V?
> > PS+ PE Y- PGP- t+ 5? X- R tv--
> > b++ Di D+ G+ e h! r y-
> > ------END GEEK CODE BLOCK------
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to