gitrequests/yii2-widget-easyautocomplete 问题修复 & 功能扩展

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

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

gitrequests/yii2-widget-easyautocomplete

Composer 安装命令:

composer require gitrequests/yii2-widget-easyautocomplete

包简介

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

README 文档

README

Yii2 widget for the EasyAutocomplete plugin (https://github.com/pawelczak/EasyAutocomplete).

Install

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies.

To install, either run

$ php composer.phar require gitrequests/yii2-widget-easyautocomplete "dev-master"

or add

"gitrequests/yii2-widget-easyautocomplete": "dev-master"

to the require section of your composer.json file.

Usage

echo EasyAutocomplete::widget([
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
    ]
]);

You can also use this widget in an [[ActiveForm]] using the [[ActiveField::widget()|widget()]] method, for example like this:

echo $form->field($model, 'address')->widget(EasyAutocomplete::className(), [
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
    ]
]);

For use with list events||functions (custom match function for example):

echo $form->field($model, 'address')->widget(EasyAutocomplete::className(), [
    'pluginOptions' => [
        'url' => Url::to('data/countries.json'),
        'getValue' => 'name'
        'list' => [
            'maxNumberOfElements' => 10,
            'match' => [
                'enabled' => true,
                'method' => new JsExpression(<<<JavaScript
                    function(element, phrase) {

                        var searches = phrase.split(' ')
                        var count = 0;

                        for (var search of searches) {
                            if (element.search(search) > -1) {
                                count++;
                            }
                        }

                        return searches.length === count
                    }
                JavaScript
                )
            ]
        ]
    ]
]);

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固