承接 corpsepk/yii2-dadata-suggestions-widget 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

corpsepk/yii2-dadata-suggestions-widget

最新稳定版本:0.4

Composer 安装命令:

composer require corpsepk/yii2-dadata-suggestions-widget

包简介

DaData Suggestions jQuery widget wrapper

README 文档

README

Latest Version Build Status Coverage Status Quality Score

Wrapper for DaData's jQuery plugin

Installation

1. Download

The preferred way to install this extension is through composer.

Run the following command:

$ composer require corpsepk/yii2-dadata-suggestions-widget:~0.4

2. Get api key

Register at DaData.ru, and get api key.

3. Configure (optional)

You can setup container definitions if you do not want to enter api key in every widget. Add following lines to your main configuration file:

'container' => [
    'definitions' => [
        'corpsepk\DaData\SuggestionsWidget' => [
            'token' => 'my-dadata-api-key',
        ],
    ],
],

Usage

use corpsepk\DaData\SuggestionsWidget;
<?= SuggestionsWidget::widget([
    'model' => $model,
    'attribute' => 'inn',
    'token' => 'your apiKey'
]) ?>

The following example will use the name property instead:

<?= SuggestionsWidget::widget([
    'name' => 'inn',
    'token' => 'your apiKey'
]) ?>

You can also use this widget in an yii\widgets\ActiveForm using the yii\widgets\ActiveField::widget() method, for example like this:

<?= $form->field($model, 'inn')->widget(SuggestionsWidget::class, [
    'token' => 'your apiKey'
]) ?>

Useful links

Testing

$ ./vendor/bin/phpunit

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-03