Tuesday, June 30, 2009

Re: Validate

I was thinking about this the other day.

There are a few validation rules I use in pretty much every
controller, such as 'required'. The following *should* work
(untested):

in AppModel:

var $rule['required'] = array(
"rule"=>array("minLength", 1),
"message"=>"cannot be blank",
"required"=>true;
)

in foo model:

var $validate = array(
"name"=>$this->rule['required']
)'

On Jun 30, 6:28 am, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
>  Just not sure how to go about it...
>
> How do I define them in app_model then relate them to each  model when
> needed.
>
>
>
> -----Original Message-----
> From: Miles J [mailto:mileswjohn...@gmail.com]
> Sent: June-30-09 2:53 AM
> To: CakePHP
> Subject: Re: Validate
>
> Well yes you could apply them in app model. Is that your main question?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: