PHPackages                             dynamikaweb/yii2-brasilapi - 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. dynamikaweb/yii2-brasilapi

ActiveYii2-extension

dynamikaweb/yii2-brasilapi
==========================

yii2 widget for zip code queries from Brazil, using BrasilApi resources

v1.0.1(4y ago)0495↓100%BSD-3-ClausePHPPHP &gt;=7.0

Since Jun 17Pushed 4y agoCompare

[ Source](https://github.com/dynamikaweb/yii2-brasilapi)[ Packagist](https://packagist.org/packages/dynamikaweb/yii2-brasilapi)[ RSS](/packages/dynamikaweb-yii2-brasilapi/feed)WikiDiscussions main Synced 1mo ago

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

dynamikaweb/yii2-brasilapi
==========================

[](#dynamikawebyii2-brasilapi)

[![php version](https://camo.githubusercontent.com/6321db4bb3a234f647a7695d47500274d22af891a5a798fa7d65dde7548ae85b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64796e616d696b617765622f796969322d62726173696c617069)](https://camo.githubusercontent.com/6321db4bb3a234f647a7695d47500274d22af891a5a798fa7d65dde7548ae85b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64796e616d696b617765622f796969322d62726173696c617069)[![pkg version](https://camo.githubusercontent.com/6eabb44f254b83f78dd755a0cd6e759e44b01fb8903ce46eb95e6975e4b56e2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64796e616d696b617765622f796969322d62726173696c617069)](https://camo.githubusercontent.com/6eabb44f254b83f78dd755a0cd6e759e44b01fb8903ce46eb95e6975e4b56e2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64796e616d696b617765622f796969322d62726173696c617069)[![license](https://camo.githubusercontent.com/2a93efa04eef624fbc7ec22f294868e0d355c4093f15723e1e461c21037ee4ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64796e616d696b617765622f796969322d62726173696c617069)](https://camo.githubusercontent.com/2a93efa04eef624fbc7ec22f294868e0d355c4093f15723e1e461c21037ee4ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f64796e616d696b617765622f796969322d62726173696c617069)[![quality](https://camo.githubusercontent.com/3d7068be4020765318daa9bed3dd878e485269cc2cc010481f4f84615eb1bfe5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f64796e616d696b617765622f796969322d62726173696c617069)](https://camo.githubusercontent.com/3d7068be4020765318daa9bed3dd878e485269cc2cc010481f4f84615eb1bfe5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f64796e616d696b617765622f796969322d62726173696c617069)[![build](https://camo.githubusercontent.com/0875552dd3bebdd6135cae46deab1f192aa04b6c6db3f276a3df1b1d7dc3e39f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f64796e616d696b617765622f796969322d62726173696c617069)](https://camo.githubusercontent.com/0875552dd3bebdd6135cae46deab1f192aa04b6c6db3f276a3df1b1d7dc3e39f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f6275696c642f672f64796e616d696b617765622f796969322d62726173696c617069)

Description
-----------

[](#description)

This library has the functionality to consume data from [BrasilAPI](https://brasilapi.com.br/), and process this data in the form of widgets. See full [API documentation](https://brasilapi.com.br/docs)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require dynamikaweb/yii2-brasilapi "*"
```

or add

```
"dynamikaweb/yii2-brasilapi": "*"
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

add the rule to your urlManager component and also add modules

```
    'components' =>[
        'urlManager' => [
            ...
            'rules' => [
                'brasilapi/' => 'brasilapi/request/index',
            ]
        ]
    ],
    ...
    'modules' => [
        'brasilapi' =>  [
            'class' => '\dynamikaweb\brasilapi\Module'
        ],
    ]
```

Widgets
-------

[](#widgets)

this widget will consume the data obtained by the api and distribute it in the fields informed in the options.

```
```

### Widget Cep

[](#widget-cep)

Remembering that the corresponding `IDs` must be added to fill in correctly. If you are using MaterializeCSS add the option `'template' => CepWidget::TEMPLATE_MATERIALIZE`.

```
use dynamikaweb\brasilapi\widgets\CepWidget;
...
echo $form->field($model, 'cep')->widget(CepWidget::className(), [
    //'template' => CepWidget::TEMPLATE_MATERIALIZE,
    'fields' => [
        'street' => 'id-model-street',
        'neighborhood' => 'id-model-neighborhood',
        'city' => 'id-model-city',
        'state' => 'id-model-state',
    ]
]);
```

or

```
echo CepWidget::widget([
    'fields' => [
        'street' => 'id-model-street',
        'neighborhood' => 'id-model-neighborhood',
        'city' => 'id-model-city',
        'state' => 'id-model-state',
    ]
]);
```

---

[![dynamika soluções web](https://avatars.githubusercontent.com/dynamikaweb?size=12)](https://dynamika.com.br)This project is under [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~18 days

Total

2

Last Release

1771d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29123479?v=4)[DornellesTV](/maintainers/RodrigoDornelles)[@RodrigoDornelles](https://github.com/RodrigoDornelles)

---

Top Contributors

[![robsondrs](https://avatars.githubusercontent.com/u/53342735?v=4)](https://github.com/robsondrs "robsondrs (5 commits)")[![RodrigoDornelles](https://avatars.githubusercontent.com/u/29123479?v=4)](https://github.com/RodrigoDornelles "RodrigoDornelles (1 commits)")

---

Tags

yii2yiidynamikaBrasilApi

### Embed Badge

![Health badge](/badges/dynamikaweb-yii2-brasilapi/health.svg)

```
[![Health](https://phpackages.com/badges/dynamikaweb-yii2-brasilapi/health.svg)](https://phpackages.com/packages/dynamikaweb-yii2-brasilapi)
```

###  Alternatives

[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78256.3k5](/packages/brussens-yii2-maintenance-mode)

PHPackages © 2026

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