Like the password field, the email field is an extension of the text field. However unlike the password field, there are no additional arguments available when creating an email input. There are other validations that are run on the value submitted by this field compared to a regular text field but these are run automatically. Therefore to create an email input, the only difference from a text input is the PHP method that is called:
1 2 |
// Create a required email field with maximum length of 50 characters $form->email = new Email('Please enter your email',true,50); |
Just like the password field, a confirmation input can be added to any email field by calling the PHP method addConfirmation() on the email field object:
1 2 |
// Add email confirmation $form->email->addConfirmation('Please confirm your email'); |
Luke Rotherfield
Freelance PHP Developer
is a PHP developer dedicated to writing the most awesome liraries for his fellow devs :) enjoy