Skip to the content
Documentation

flag_icon

No ratings yet

Summary

Outputs an image tag referencing a flag icon.

Usage

input|flag_icon()

Returns

A string containing an image tag.

Description

This operator generates an image tag that references a flag icon. The country code must be provided using the input parameter. This operator is frequently used by the administration interface.

Examples

Example 1
{'eng-GB'|class_icon()}

The following output will be produced:

<img src="/share/icons/flags/eng-GB.gif" alt="English (United Kingdom)" />

Contributors

Comments (2 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. It's flag_icon and not class_icon

    Maxime THOMAS ·

    Just flag and not class in Exemple #1.

  2. not complete image tag

    Bergfrid Skaara ·

    The code example above (with the commented typo fixed), does not result in a complete image tag, only outputs the string that should be used for the src parameter in the tag.

Comments

Add a comment

Comments are read by a moderator before they appear.