Customizable CakePHP validation technique with parameters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Customizable CakePHP validation technique with parameters

Evan-21

I've posted the validation technique that I've created a few months
back.  Here's the link in case anyone wants to see it:

http://evanities.wordpress.com/2006/11/05/cakephp-validation-technique/

I'll also probably post this in the bakery as soon as I can.


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

Reply | Threaded
Open this post in threaded view
|

Re: Customizable CakePHP validation technique with parameters

Mariano Iglesias

I had to fix a few things before it started working:

1. On fieldErrors() at error helper i changed parameter name from
$fieldName to $target.

2. I removed all contentTag() declarations and made the fieldErrors()
method return the first error found instead.

3. On the controller, $model->validates() is not longer working, so you
can't do stuff like:

if ($this->Model->validates($this->data))
$this->Model->save($this->data)

But plain:

if ($this->Model->save($this->data))

Other than that great job.

PS: How can we get notified when this snippet updates? Through the
Bakery maybe?


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