fernandovaller/flags-brazilian-states

Flags of the Brazilian states

v1.4 2023-05-26 19:28 UTC

This package is auto-updated.

Last update: 2024-10-26 22:27:15 UTC


README

Latest Stable Version Total Downloads License

Bandeiras dos estados brasileiros

Bandeiras dos estados brasileiros em formato base64 e tamanho 21x14

Instalação

Faça a instalação no seu projeto via require

$ composer require fernandovaller/flags-brazilian-states

Obter a bandeira do estado

<?php

use FVCode\FlagsBrasilStates\Flags;

require __DIR__ . '/vendor/autoload.php';

echo Flags::uf('AC');

/**
 * Out (string):
 * data:image/webp;base64,UklGRrYAAABXRUJQVlA4TKoAAAAvE0ADANegJgAIhs8pgnaii7BHDbYBAJYJt/x/oW2ViiFJkvqcUVh/l/VZgH3Mf1g74YeH8If2yLHv5Jpmaaui3SPlI1WFKeejcnS0GfYf3Ja/4T8ifQk1BKDyYSxgGElSosPh3eYt/1CxECL6PwHS0c4iz9sQN+T+/7vGTBeI/j5dEVYAcc/jCmo8ydT6hXxN2mmyM5WFuNFkpoumsNIoosaTJr/QPhx0BA==
 */

Para usar basta inserir o retorno do método Flags::uf('AC') no src de tag <img src="...">, como no exemplo:

<img src="data:image/webp;base64,UklGRrYAAABXRUJQVlA4TKoAAAAvE0ADANegJgAIhs8pgnaii7BHDbYBAJYJt/x/oW2ViiFJkvqcUVh/l/VZgH3Mf1g74YeH8If2yLHv5Jpmaaui3SPlI1WFKeejcnS0GfYf3Ja/4T8ifQk1BKDyYSxgGElSosPh3eYt/1CxECL6PwHS0c4iz9sQN+T+/7vGTBeI/j5dEVYAcc/jCmo8ydT6hXxN2mmyM5WFuNFkpoumsNIoosaTJr/QPhx0BA==" />

Obter informações sobre o estado

<?php

use FVCode\FlagsBrasilStates\Flags;

require __DIR__ . '/vendor/autoload.php';

echo Flags::info('AC');

/**
 * Out (array):
 * [
 *   [id] => AC,
 *   [stage] => Acre,
 *   [capital] => Rio Branco,
 *   [flag] => data:image/webp;base64,UklGRrYAAABXRUJQVlA4TKoAAAAvE0ADANegJgAIhs8pgnaii7BHDbYBAJYJt/x/oW2ViiFJkvqcUVh/l/VZgH3Mf1g74YeH8If2yLHv5Jpmaaui3SPlI1WFKeejcnS0GfYf3Ja/4T8ifQk1BKDyYSxgGElSosPh3eYt/1CxECL6PwHS0c4iz9sQN+T+/7vGTBeI/j5dEVYAcc/jCmo8ydT6hXxN2mmyM5WFuNFkpoumsNIoosaTJr/QPhx0BA==
 * ]
 */

Obter tag img

<?php

use FVCode\FlagsBrasilStates\Flags;

require __DIR__ . '/vendor/autoload.php';

echo Flags::img('PI', 20);

/**
 * Out (string):
 * <img src="data:image/webp;base64,...." title="Piauí" width="20"/>
 */

Licença

License