PHPackages                             alaczi/twig-country-extension - 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. [Templating &amp; Views](/categories/templating)
4. /
5. alaczi/twig-country-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

alaczi/twig-country-extension
=============================

Twig country filter extension for twig

v1.2.0(7y ago)549.7k2MITPHPPHP &gt;=5.3.0

Since Jan 19Pushed 7y agoCompare

[ Source](https://github.com/alaczi/twig-country-extension)[ Packagist](https://packagist.org/packages/alaczi/twig-country-extension)[ Docs](http://github.com/alaczi/twig-country-extension)[ RSS](/packages/alaczi-twig-country-extension/feed)WikiDiscussions master Synced 3d ago

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

Usage
=====

[](#usage)

Require as dependency
---------------------

[](#require-as-dependency)

```
    composer require alaczi/twig-country-extension
```

Register the extension
----------------------

[](#register-the-extension)

### PHP

[](#php)

```
    $filter = new \alaczi\Twig\Extension\CountryExtension();
    $twig = new Twig_Environment($loader);
    $twig->addFilter($filter);
```

### Symfony 2

[](#symfony-2)

```
services:
    alaczi.twig.country_extension:
        class: alaczi\Twig\Extension\CountryExtension
        tags:
            - { name: twig.extension }
```

### Silex

[](#silex)

```
    $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
        /** @var \Twig_Environment $twig */
        $twig->addExtension(new \alaczi\Twig\Extension\CountryExtension())
        return $twig;
    }));
```

Usage in twig
-------------

[](#usage-in-twig)

```
    {{ countryCode|country }}
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~386 days

Total

4

Last Release

2658d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3229101?v=4)[Andras Laczi](/maintainers/alaczi)[@alaczi](https://github.com/alaczi)

---

Top Contributors

[![alaczi](https://avatars.githubusercontent.com/u/3229101?v=4)](https://github.com/alaczi "alaczi (3 commits)")[![markitosgv](https://avatars.githubusercontent.com/u/1706470?v=4)](https://github.com/markitosgv "markitosgv (1 commits)")[![tristanbes](https://avatars.githubusercontent.com/u/346010?v=4)](https://github.com/tristanbes "tristanbes (1 commits)")

---

Tags

symphonytwigtwig-extensiontwigfilterextensioncountry

### Embed Badge

![Health badge](/badges/alaczi-twig-country-extension/health.svg)

```
[![Health](https://phpackages.com/badges/alaczi-twig-country-extension/health.svg)](https://phpackages.com/packages/alaczi-twig-country-extension)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[twig/intl-extra

A Twig extension for Intl

36569.4M352](/packages/twig-intl-extra)[symfony/ux-twig-component

Twig components for Symfony

22018.6M356](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1647.0M127](/packages/symfony-ux-live-component)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M572](/packages/shopware-core)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
