2amigos/yii2-selectize-widget

This package is abandoned and no longer maintained. No replacement package was suggested.

The selectize.js widget for the Yii framework

Installs: 893 905

Dependents: 38

Suggesters: 1

Security: 0

Stars: 74

Watchers: 20

Forks: 39

Open Issues: 9

Type:yii2-extension

1.1.0 2017-09-19 22:02 UTC

This package is auto-updated.

Last update: 2023-08-16 02:58:41 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Selectize is an extensible jQuery-based custom <select> UI control. It's useful for tagging, contact lists, country selectors, and so on. It clocks in at around ~7kb (gzipped). The goal is to provide a solid & usable experience with a clean and powerful API.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require 2amigos/yii2-selectize-widget:~1.0

or add

"2amigos/yii2-selectize-widget": "~1.0"

to the require section of your composer.json file.

Usage

Selectize has lots of configuration options. For further information, please check the Selectize plugin website.

Text input widget

To use text input widget add the following to the view

use dosamigos\selectize\SelectizeTextInput;

echo SelectizeTextInput::widget([
    'name' => 'tags',
    'value' => 'love, this, game',
    'clientOptions' => [
        // ...
    ],
]);

Dropdown list widget

To use dropdown list widget add the following to the view

use dosamigos\selectize\SelectizeDropDownList;

echo SelectizeDropDownList::widget([
    'name' => 'tags',
    'items' => ['love', 'this', 'game'],
    'clientOptions' => [
        // ...
    ],
]);

Configuration

SelectizeDropDownList extends from InputWidget, but have additional properties that can be configured.

Property Type Default Description
loadUrl string|array null Optional. This parameter will be passed to Url::to. If set, selectize plugin will be configured to send ajax requests to the defined url to retrieve options. Url must return a valid JSON response.
queryParam string 'query' The name of the request parameter to use on ajax requests
clientOptions array null Configuration of selectize plugin. This configuration is individual for each selectize instance.

Testing

$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67
web development has never been so fun
www.2amigos.us