PHP code example of fullscreeninteractive / silverstripe-addressfinder

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

    

fullscreeninteractive / silverstripe-addressfinder example snippets




use SilverStripe\ORM\DataObject;

class AddressObject extends DataObject
{
    private static $db = [
        'Address' => 'Text',
        'PostalLine1' => 'Varchar(200)',
        'PostalLine2' => 'Varchar(200)',
        'PostalLine3' => 'Varchar(200)',
        'PostalLine4' => 'Varchar(200)',
        'PostalLine5' => 'Varchar(200)',
        'PostalLine6' => 'Varchar(200)',
        'Suburb' => 'Varchar(200)',
        'City' => 'Varchar(200)',
        'Postcode' => 'Varchar(200)',
        'Latitude' => 'Varchar(200)',
        'Longitude' => 'Varchar(200)'
    ];
}

AddressFinderField::create('HomeAddress')
    ->setFieldPrefix('Home')
AddressFinderField::create('WorkAddress')
    ->setFieldPrefix('Work')

// ',
    'HomeAddressPostalLine3' => 'Varchar(200)',
    'HomeAddressPostalLine4' => 'Varchar(200)',
    'HomeAddressPostalLine5' => 'Varchar(200)',
    'HomeAddressPostalLine6' => 'Varchar(200)',
    'HomeAddressSuburb' => 'Varchar(200)',
    'HomeAddressCity' => 'Varchar(200)',
    'HomeAddressPostcode' => 'Varchar(200)',
    'HomeAddressLatitude' => 'Varchar(200)',
    'HomeAddressLongitude' => 'Varchar(200)',
    'WorkAddress' => 'Text',
    'WorkAddressPostalLine1' => 'Varchar(200)',
    'WorkAddressPostalLine2' => 'Varchar(200)',
    //...
];