定制 luiseduardo/yii2-correios 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

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.

Yii2 Latest Stable Version Code Climate Total Downloads

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2025-04-06