PHP code example of goldfinch / google-fields

1. Go to this page and download the library: Download goldfinch/google-fields 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/ */

    

goldfinch / google-fields example snippets


use Goldfinch\GoogleFields\Forms\MapField;

private static $db = [
    'Map' => 'Map',
];

// ..

MapField::create('Map')

//

MapField::create('Map', 'Map')
    ->setSettings([
        'lng' => 168.7439017,
        'lat' => -45.0136784,
        'zoom' => 10,
    ])
    ->mapHideSearch()
    ->mapHideExtra()
    ->mapReadonly()

use Goldfinch\GoogleFields\Forms\PlaceField;

private static $db = [
    'Place' => 'Place',
];

// ...

PlaceField::create('Place')

//

PlaceField::create('Place', 'Place')
    ->setSettings([
      'country' => 'ru',
    ])
    ->placeHidePreview()