Cool country flags in Yii2

I just would like to share what I recently have found.

If you need some flags in your application you can add them easily via composer: yii2-flags. Project page:

You just have to install it, register the asset into your view and use the widget. Quite easy and simple.

use yii\flags\Flags;

use yii\flags\FlagsAsset;


<?= Flags::widget([

  'flag' => 'UA',

  'type' => Flags::FLAT_24,

  'useSprite' => false // use sprite image? default is false

]); ?>

That’s all. Then you have hundreds of flags you can use.

Is there also an extension for Yii 1.1.15?

Cool extension, thanks for sharing it!