PHPackages                             necris/selectt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. necris/selectt

ActiveLibrary

necris/selectt
==============

Simple implementation of Select2 for Nette framework

1.2.0(6mo ago)2196↓50%PHPPHP &gt;=8.0

Since Aug 13Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/necris/selectt)[ Packagist](https://packagist.org/packages/necris/selectt)[ RSS](/packages/necris-selectt/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (9)Used By (0)

Selectt
-------

[](#selectt)

Simple implementation of Select2 for Nette Framework.

How to use:

1. register extension in config:

```
extensions:
    selectt: Selectt\DI\SelecttExtension
```

2. add some configuration

```
selectt:
  single:
    class: select2-ajax
    jsAttributes:
      allowClear: true
      placeholder: Please select option
      width: 100%
  multi:
    class: select2-ajax-multi
    jsAttributes:
      allowClear: true
      placeholder: Please select
      width: 100%
```

Section `jsAttributes` contains any Slelect2 parameter you like. If you want to use that parameter only on one select, you can also use metho `->addSelect2Attribute($name, $value)` on corresponding object.

3. include Select2 to your project
4. init Select2 for desired class

```
$(function(){
    $('.select2-ajax').each(function () {
        let params = $(this).data().select2Params;
        params.ajax = {
            url: $(this).data('select2-url'),
            dataType: 'json'
        };

        $(this).select2(params);
    });

    $('.select2-ajax-multi').each(function () {
        let params = $(this).data().select2Params;
        params.ajax = {
            url: $(this).data('select2-url'),
            dataType: 'json'
        };

        $(this).select2(params);
    });
});
```

5. create ajax autocomplete component with your own implementation of `Selectt\SelecttDataSource`

```
public function createComponentAutocomplete(): SelecttAutocompleteControl
{
  $a = new SelecttAutocompleteControl(new ArrayDataSource([
      1 => "Praha",
      2 => "Brno",
      3 => "Paříž",
      4 => "Hitler",
      5 => "patří",
      6 => "za",
      7 => "mříž"
  ]));
  $a->enableEmptyQuery();
  return $a;
}
```

6. finaly add select2 or multiselect to form. As second parameter provide autocomplete component!

```
public function createComponentForm(): Nette\Application\UI\Form
{
    $f = new Nette\Application\UI\Form();
    $f->addText("text", "text");
    $f->addSelect2("select2", $this['autocomplete'], "Best select in the world");
    $f->addSelect2Multi("select2multi", $this['autocomplete'], "Best multiselect ever");
    .
    .
    .
    return $f;
}
```

7. profit!

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance66

Regular maintenance activity

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~220 days

Recently: every ~115 days

Total

8

Last Release

200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/848a1d108c9dfe45d2d66b22615a16429a7416a0e43f4b28bb6e20c6a5f0f85f?d=identicon)[necris](/maintainers/necris)

---

Top Contributors

[![necris](https://avatars.githubusercontent.com/u/182970?v=4)](https://github.com/necris "necris (5 commits)")

### Embed Badge

![Health badge](/badges/necris-selectt/health.svg)

```
[![Health](https://phpackages.com/badges/necris-selectt/health.svg)](https://phpackages.com/packages/necris-selectt)
```

###  Alternatives

[contributte/forms-bootstrap

Nette extension for Bootstrap forms

211.1M4](/packages/contributte-forms-bootstrap)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)[nasext/dependent-select-box

Dependent Select Box for Nette Framework.

21262.8k2](/packages/nasext-dependent-select-box)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
