Skip to content

A phone number field for the SilverStripe CMS with validation using libphonenumber.

License

Notifications You must be signed in to change notification settings

6fdigital/silverstripe-phone-field

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilverStripe Phone Field

A phone number field for the SilverStripe CMS with validation using libphonenumber.

Requirements

Installation

composer require "6fdigital/silverstripe-phone-field"

Usage

The PhoneField can be used in your custom forms and with the SilverStripe Userforms module. For usage in your custom Forms simply add the form to your field list:

use SixF\PhoneField\PhoneField;

public function MyForm(): Form {
    return Form::create(
        $this,
        "MyForm",
        FieldList::create(
            ...
            PhoneField::create('PhoneNumber', 'Your Phone Number')
            ...
        ),
        FieldList::create(
            FormAction::create('doSubmit', 'Submit')
        ),
        RequiredFields::create('Phone')
        );
    }
}

About

A phone number field for the SilverStripe CMS with validation using libphonenumber.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages