PHP code example of webtorque / silverstripe-nhi-field

1. Go to this page and download the library: Download webtorque/silverstripe-nhi-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/ */

    

webtorque / silverstripe-nhi-field example snippets


class Patient extends DataObject {
    private static $db = [
        'NationalHealthIndex' => 'NHI',
    ];
}


$nhiField = NHIField::create(
    $name = 'nhi',                      // ',                 // optional
    $form = null,                       // optional
    $html5pattern = false               // optional, output an `html5` pattern attribute
);


if (Director::isDev()) {
    NHIField::config()->disable_checksum_validation = true;
}