onedrop/phoneutil

Last activity on 10 October 2017
  • 2
  • 2512
composer require onedrop/phoneutil

Utilities to deal with phone numbers

0.1.1

Utilities to deal with phone numbers

Version
0.1.1
Type
neos-package
Release Date
05.10.2017 13:05:18
Source
git
Distribution
zip
Requires
Requires (dev)
None
Suggest
None
Provides
None
Conflicts
None
Replaces
None
MIT 4b2a03d0e358aa3b41b9b4c8b21ba4c5ab244101

Onedrop.PhoneUtil

This Neos package provides some functionality to deal with phone numbers in your daily work with Flow and Neos.

Validation

<?php
namespace Vendor\Package\Domain\Model;
use Neos\Flow\Annotations as Flow;

class SomeEntity {
    /**
     * @var string
     * @Flow\Validate(type="Onedrop.PhoneUtil:PhoneNumber")
     */
     protected $phoneNumber;
}

Eel utility

Reformat into daillable number (output as tel: link):

phoneNumber = ${Phone.toDiallableNumber(q(node).property('number'), 'DE')}
# output '+4989123456789'

Geocode the phone number:

city = ${Phone.geocode(q(node).property('number'), 'DE')}
# output 'München'
city = ${Phone.geocode(q(node).property('number'), 'EN')}
# output 'Munich'

Extract numbers from a text:

phoneNumbersInText = ${Phone.extractNumbers(q(node).property('description'), 'DE')}
# outputs a RawArray containing the the possible phone numbers (unmodified)

Typeahead ajax formatting

A special endpoint __phone/format is provided.

The content of the readme is provided by Github
The same vendor provides 19 package(s).