This class can be used for your form validation either on the server side or can be called from the client side via ajax calls, but the processing will happen only on server side. The return type of the functions are boolean so you only have to check true or false and adjust the flow based on return value.