Download the PHP package bohnmedia/contao-flag-icons-bundle without Composer
On this page you can find all versions of the php package bohnmedia/contao-flag-icons-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bohnmedia/contao-flag-icons-bundle
More information about bohnmedia/contao-flag-icons-bundle
Files in bohnmedia/contao-flag-icons-bundle
Package contao-flag-icons-bundle
Short Description Contao 5 wrapper around lipis/flag-icons — render country flags via insert tag or Twig function.
License MIT
Informations about the package contao-flag-icons-bundle
Contao Flag Icons Bundle
A small Contao 5 wrapper around lipis/flag-icons. It renders
country flags as <img> tags via an insert tag or a Twig function.
Installation
Usage
Insert tag
renders
More examples:
Twig
The alt attribute is the localised country name from Contao's Countries
service — German in a German page context, English in an English one, etc.
Parameters
| Parameter | Default | Description |
|---|---|---|
ratio |
4x3 |
Aspect ratio of the SVG. Allowed values: 4x3, 1x1. |
width |
40 |
Value for the width attribute. The height attribute is computed from the ratio (e.g. width=24 on 4x3 → width="24" height="18"). |
alt |
— | Override for the alt attribute. Pass an empty string for decorative use. |
If the country code is unknown (no matching SVG in the installed library), both the insert tag and the Twig function render as an empty string.
Styling
The bundle ships no CSS. Three BEM classes are emitted on every <img>:
flag-icon— block-level hook for all flagsflag-icon--{code}— country-specific modifier (e.g.flag-icon--de)flag-icon--{ratio}— ratio-specific modifier (e.g.flag-icon--1x1)
Use these to apply your own styles, for example:
height: auto ensures the height re-derives from the intrinsic aspect
ratio when you only set width in CSS.
License
MIT.
All versions of contao-flag-icons-bundle with dependencies
contao/core-bundle Version ^5.0
contao/manager-plugin Version ^2.0
lipis/flag-icons Version ^7.0
symfony/http-kernel Version ^6.4 || ^7.0