yiibr/yii2-correios 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yiibr/yii2-correios

最新稳定版本:2.0.4

Composer 安装命令:

composer require yiibr/yii2-correios

包简介

Locates an address in Brazil by postal code

README 文档

README

This extension allows automatic completion and search Brazilian address.

Yii2 Latest Stable Version Code Climate Total Downloads

Installation

Add to the require section of your composer.json file:

"yiibr/yii2-correios": "*"

Configuration

On your controller.

public function actions()
{
    return [
        ...
        'addressSearch' => 'yiibr\correios\CepAction'
        ...
    ];
}

How to use

On your view file.

<?php
use yiibr\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('yiibr\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() ?>

统计信息

  • 总下载量: 14.17k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 6
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2014-04-07