PHP Classes

File: src/Field/Text/EmailAddress.php

Recommend this page to a friend!
  Classes of Derek McLean   HTML Forms   src/Field/Text/EmailAddress.php   Download  
File: src/Field/Text/EmailAddress.php
Role: Class source
Content type: text/plain
Description: Class source
Class: HTML Forms
Generate and validate submitted HTML forms
Author: By
Last change:
Date: 6 years ago
Size: 580 bytes
 

Contents

Class file image Download
<?php
/**
 * User: delboy1978uk
 * Date: 04/12/2016
 * Time: 17:24
 */

namespace Del\Form\Field\Text;

use
Del\Form\Field\Text;
use
Del\Form\Validator\Adapter\ValidatorAdapterZf;
use
Zend\Validator\EmailAddress as EmailValidator;

class
EmailAddress extends Text
{
    public function
init()
    {
       
parent::init();
       
$this->setAttribute('type', 'email');
       
$this->setAttribute('placeholder', 'Enter an email address..');
       
$emailAddressValidator = new ValidatorAdapterZf(new EmailValidator());
       
$this->addValidator($emailAddressValidator);
    }
}