PHP code example of lekoala / silverstripe-phonenumber
1. Go to this page and download the library: Download lekoala/silverstripe-phonenumber library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lekoala / silverstripe-phonenumber example snippets
$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'))));