PHP code example of kadegray / statamic-country-and-region-fieldtypes

1. Go to this page and download the library: Download kadegray/statamic-country-and-region-fieldtypes 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/ */

    

kadegray / statamic-country-and-region-fieldtypes example snippets

html
{{ user:register_form }}
...
<label for="country">Country:</label>
<select name="country" id="country">
    {{ countries_and_regions:countries default="AU" }}
    <option value="{{ isoCode }}" {{ selected }}>
        {{ countryName }}
    </option>
    {{ /countries_and_regions:countries }}
</select>
...
{{ /user:register_form }}
html
{{ user:register_form }}
...
<label for="region">Region:</label>
<select name="region" id="region">
    {{ countries_and_regions:regions country="AU" default="AU-NSW" }}
    <option value="{{ isoCode }}" {{ selected }}>{{ regionName }}</option>
    {{ /countries_and_regions:regions }}
</select>
...
{{ /user:register_form }}