2017 © Pedro PelĆ”ez
 

silverstripe-module silverstripe-phonenumber

Adds libphonenumber to Silverstripe

image

lekoala/silverstripe-phonenumber

Adds libphonenumber to Silverstripe

  • Friday, March 25, 2016
  • by lekoala
  • Repository
  • 1 Watchers
  • 2 Stars
  • 251 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 10 % Grown

The README.md

SilverStripe PhoneNumber module

Build Status scrutinizer Code coverage, (*1)

Intro

Provide some helper services to deal with phone numbers in SilverStripe, (*2)

This module integrates libphonenumber as the utility to parse and validate phonenumbers., (*3)

Most of the time, it's a good idea to set the country of the phone number. Otherwise, current locale will be used., (*4)

Sample code:, (*5)

    $phone = new PhoneField('phone', 'Phone number');
    $phone->setCountryField('CountryCode');

    $validator = ZenValidator::create();
    $validator->setConstraint('phone', Constraint_remote::create('/__phonenumber/validate',null,array('data' => array('country' => 'BE'))));

This module also provide an extension to apply to dataobject, for example to members, (*6)

SilverStripe\Security\Member:
  extensions:
    - LeKoala\PhoneNumber\PhoneNumberExtension

Phone DBField

You can set your DataObject db field to Phone or DBPhone::class, (*7)

This will automatically scaffold a CountryPhoneField which is a combo field with a country dropdown (with list of prefixes) and a space for the field itself, (*8)

Form fields

Two available fields:, (*9)

  • PhoneField : a plain phone field that supports national and international numbers
  • CountryPhoneField : a combo field with a country dropdown + national phone number

Ajax validation and formatting

Expose Ā“phonenumber/validateĀ“ and Ā“phonenumber/formatĀ“ endpoints for validation and formatting of phone numbers, (*10)

Todo

None, (*11)

Compatibility

Tested with 5.x but should work on any ^4|^5 projects, (*12)

Maintainer

LeKoala - thomas@lekoala.be, (*13)

The Versions

25/03 2016

dev-master

9999999-dev

Adds libphonenumber to Silverstripe

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar lekoala

module cms silverstripe libphonenumber