luiseduardo/yii2-correios
最新稳定版本:3.0.1
Composer 安装命令:
composer require luiseduardo/yii2-correios
包简介
Locates an address in Brazil by postal code
README 文档
README
This extension allows automatic completion and search Brazilian address.
Installation
Add to the require section of your composer.json file:
"luiseduardo/yii2-correios": "*"
Configuration
On your controller.
public function actions() { return [ ... 'addressSearch' => 'luiseduardo\correios\CepAction' ... ]; }
How to use
On your view file.
<?php use luiseduardo\correios\CepInput; ?> ... <?= CepInput::widget([ 'name' => 'cep', 'action' => ['addressSearch'], 'fields' => [ 'location' => 'location_input_id', 'district' => 'district_input_id', 'city' => 'city_input_id', 'state' => 'state_input_id' ], ]); ?>
// Example: <?= $form->field($model, 'cep',)->widget('luiseduardo\correios\CepInput', [ 'action' => ['addressSearch'], 'fields' => [ 'location' => 'address-location', 'district' => 'address-district', 'city' => 'address-city', 'state' => 'address-state', ], ]) ?> <?= $form->field($model, 'location')->textInput() ?> <?= $form->field($model, 'district')->textInput() ?> <?= $form->field($model, 'city')->textInput() ?> <?= $form->field($model, 'state')->textInput() ?>
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2025-04-06