POSTS
Validate Your User Before Any Method Call
In the app we’re developing, I want the registration process to be as painless as possible, so the registration form only asks you for a few very basic things:
- username
- password
However we want to have a user’s full information before he can participate in more “advanced” parts of the app. For example if you were an online air ticketing company, before allowing to proceed with a ticket checkout, you need the user’s full name, passport number and other things.
Using validation groups it’s very easy to group all the info you need for ticket checkout and then ask the validator if anything is missing. In every action where you need this, you could do something like this: