The yii2-selectivity is a Yii 2 wrapper for Selectivity.js
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitattributes
.gitignore
.scrutinizer.yml
.travis.yml
CHANGELOG.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

yii2-selectivity

Latest Version Software License Total Downloads

Install

Via Composer

$ composer require wbraganca/yii2-selectivity

or add

"wbraganca/yii2-selectivity": "*"

to the require section of your composer.json file.

Usage

On your view file.


<?php
use wbraganca\selectivity\SelectivityWidget;
?>

<?= $form->field($model, 'city')->widget(SelectivityWidget::classname(), [
    'pluginOptions' => [
        'allowClear' => true,
        'items' => ['Amsterdam', 'Antwerp'],
        'placeholder' => 'No city selected'
    ]
]) ?>

For more options, visit: https://arendjr.github.io/selectivity/#api