PHP code example of 6fdigital / silverstripe-phone-field

1. Go to this page and download the library: Download 6fdigital/silverstripe-phone-field 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/ */

    

6fdigital / silverstripe-phone-field example snippets


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')
        );
    }
}