Usage

EmailAddressInput is form control that uses email address value object to represent its value (see nepada/email-address for further details).
It automatically validates the user input and getValue() method always returns EmailAddress instance, or null if the input is not filled.

$emailAddressInput=$form->addEmailAddress('E-mail');// set value using EmailAddress value object$emailAddressInput->setValue(EmailAddress::fromString('example@example.com'));// set value using string with a valid email address (it is internally converted to EmailAddress value object)$emailAddressInput->setValue('example@example.com');// Get EmailAddress instance for example@example.com$emailAddressInput->getValue();// InvalidEmailAddressException is thrown$emailAddressInput->setValue('42');