Wednesday, September 29, 2010

Redirection based on validation results.

Each server has many players and players belong to a server.

Each player may have the same first and last name but only one per
server.

I have a custom validation that is working correctly when the form is
submitted.

My thoughts were to kill two birds with one stone and have the
validation function return 0 for nothing found or the player id if
found. Everything works perfectly with this setup for simply
validating when the form is submitted.

I've seen the handbook on redirecting from the controller based on
over all success. However, I want to redirect to the players page if
a user was found. Is it possible to get the value returned by a
validation function or will I just have to run the query again?

If that's the case, I should check the validation at the controller,
read the returned validation results, and check it for my custom rule
failure?


Is this how I should go about this or is my focus preventing me from
seeing the bigger picture? Thanks for any assistance and insights.


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: