dynamikaweb/yii2-brasilapi 问题修复 & 功能扩展

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

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

dynamikaweb/yii2-brasilapi

最新稳定版本:v1.0.1

Composer 安装命令:

composer require dynamikaweb/yii2-brasilapi

包简介

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

README 文档

README

php version pkg version license quality build

Description

This library has the functionality to consume data from BrasilAPI, and process this data in the form of widgets. See full API documentation

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require dynamikaweb/yii2-brasilapi "*"

or add

"dynamikaweb/yii2-brasilapi": "*"

to the require section of your composer.json file.

Usage

add the rule to your urlManager component and also add modules

    'components' =>[
        'urlManager' => [
            ...
            'rules' => [
                'brasilapi/<route:[a-zA-Z0-9\/-]+>' => 'brasilapi/request/index',
            ]
        ]
    ],
    ...
    'modules' => [
        'brasilapi' =>  [
            'class' => '\dynamikaweb\brasilapi\Module'
        ],
    ]

Widgets

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


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 This project is under BSD-3-Clause license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-06-16