validateRegistrationForm() hook
A hook that validates the input into the user registration form to make sure that the input is valid.
Signature
function validateRegistrationForm( array $values ) : mixed
Parameters
| Name | Description |
|---|---|
| $values | An associative array of the input values of the registration form. |
| returns | Mixed. If this method returns a PEAR_Error object then the validation will fail - and the user will be asked to correct his input. |
Example
<?php
class conf_ApplicationDelegate {
function validateRegistrationForm($values){
if ( $values['age'] < 18 ){
return PEAR::raiseError("Sorry you must be at least 18 years old to join this site.");
}
return true;
}
}
Validation via the Users table Delegate class
Note that since the registration form is just a “new record form” for the users table, it is also possible (and preferred) to do validation through the users table delegate class.
See Also
- afterRegister
- beforeRegister
- sendRegistrationActivationEmail
- getRegistrationActivationEmailInfo
- getRegistrationActivationEmailSubject
- getRegistrationActivationEmailMessage
- getRegistrationActivationEmailParameters
- getRegistrationActivationEmailHeaders
var disqus_identifier = ‘xataface.com/wiki/validateRegistrationForm’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus
//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘