2017 © Pedro Peláez
 

library options

Used to create lists of countries and states.

image

digital-canvas/options

Used to create lists of countries and states.

  • Sunday, May 22, 2016
  • by spekkionu
  • Repository
  • 2 Watchers
  • 0 Stars
  • 150 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

States Options

Latest Stable Version Total Downloads License Build Status Scrutinizer Code Quality Code Coverage Build Status SensioLabsInsight, (*1)

Used to create lists of countries and US and CA states/provinces., (*2)

Installation

composer require digital-canvas/options

Usage

Create an array with state abbreviations as keys and full names as values

// US states only
$states = \DigitalCanvas\Options\States::getPairs(['US']);
// US states and CA provinces
$states = \DigitalCanvas\Options\States::getPairs(['US', 'CA']);

Create an array with abbreviations as keys and full array of state data as values

// US states only
$states = \DigitalCanvas\Options\States::getArray(['US']);
// US states and CA provinces
$states = \DigitalCanvas\Options\States::getArray(['US', 'CA']);

Create a <select> list for state selection

<select name="state">
  <?php foreach(\DigitalCanvas\Options\States::getPairs(['US']) as $abbr => $label):?>
    <option value="<?php echo htmlspecialchars($abbr);?>"><?php echo htmlspecialchars($label);?></option>
  <?php endforeach; ?>
</select>

The Versions

22/05 2016
22/05 2016

1.0.2

1.0.2.0

Used to create lists of countries and states.

  Sources   Download

MIT

The Development Requires

22/05 2016

1.0.1

1.0.1.0

Used to create lists of countries and states.

  Sources   Download

MIT

The Development Requires

22/05 2016

1.0.0

1.0.0.0

Used to create lists of countries and states.

  Sources   Download

MIT

The Development Requires