PHPackages                             shiftpi/country-flags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. shiftpi/country-flags

AbandonedArchivedLibrary

shiftpi/country-flags
=====================

Provides access to various country flags

0.1.2(11y ago)362[1 issues](https://github.com/shiftpi/CountryFlags/issues)MITPHPPHP &gt;=5.3.3

Since May 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/shiftpi/CountryFlags)[ Packagist](https://packagist.org/packages/shiftpi/country-flags)[ Docs](https://github.com/shiftpi/CountryFlags)[ RSS](/packages/shiftpi-country-flags/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

[![Code Climate](https://camo.githubusercontent.com/04032231fab2dc2174b28c4d332cbd4d8a0c024c2a66a5dfac2a1e7b3b046d9a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736869667470692f436f756e747279466c6167732f6261646765732f6770612e737667)](https://codeclimate.com/github/shiftpi/CountryFlags)

\#ShiftpiCountryFlags Provides access to various country flags

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

Require `shiftpi/country-flags` in your `composer.json`. Then update your dependencies. You can now enable the module in the `config/application.config.php` file:

```
// ...
'modules' => array(
    // ...
    'ShiftpiCountryFlags',
    // ...
),
// ...
```

If you are using Windows, make sure `php_fileinfo.dll` is loaded.

Configuration
-------------

[](#configuration)

Copy `vendor/shiftpi/country-flags/config/shiftpicountryflags.global.php.dist` to `config/autoload/shiftpicountryflags.global.php`.

Edit the configuration file (if needed):

```
return array(
    'countryflags' => array(
        'mapper' => 'ShiftpiCountryFlags\Mapper\Filename',      // country code -> file path mapper
        'datapath' => '/alternative/data/path',                 // new since 0.1.1; optional
    ),
);
```

Usage
-----

[](#usage)

### Route

[](#route)

By default the module provides a route to access the flags:

```
/countryflags/[/]

```

Where countrycode is the ISO 3166 ALPHA-2 code (see [https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-2#Officially\_assigned\_code\_elements](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)). Size defines the width and height of the flag in px. Possible values are 16, 24, 32, 48, 64. Default is 16.

### View Helper

[](#view-helper)

```
