6fdigital / silverstripe-phone-field
A phone number field for the SilverStripe CMS with validation using libphonenumber
Installs: 47
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- giggsey/libphonenumber-for-php: ^8.13
- silverstripe/framework: ^4 | ^5
This package is auto-updated.
Last update: 2024-12-17 01:34:56 UTC
README
A phone number field for the SilverStripe CMS with validation using libphonenumber.
Requirements
- SilverStripe ^4 | ^5
- libphonenumber-for-php
- SilverStripe Userforms (optional)
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') ); } }