Download the PHP package dakujem/selectoo without Composer

On this page you can find all versions of the php package dakujem/selectoo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package selectoo

Selectoo

[PHP from Packagist]()

SelectBox & MultiSelectBox hybrid input with lazy & asynchronous options loading capabilities to be used with Select2, Selectize, Chosen and similar UI libraries.

The aim of Selectoo is to provide a flexible tool for creating reusable select inputs.

Features

Usage / Use cases

Reusable inputs with specific setup:

See included examples for more information.

Configuring Selectoo input

Create a (multi)select box with fixed options

or a (multi)select box with options loaded on demand (lazy loading).

An engine can optionally be attached

and configured.

The Select2Engine is configured using magic options (or setOption method). The names of the magic methods (or option names) represent the Select2 configuration options.

Lazy options loading & AJAX

Lazy loading is used when the Selectoo instance is given "item callback" callable instead of an array of items. The callable is supposed to return a list of items.

The item callback also works as a validator for values. It receives raw value as the first argument (and the input instance as the second). The callback should return the array of possible values (these are the items) in form exactly the same as the items set to SelectBox or MultiSelectBox inputs. The raw value is then compared to the returned items and filtered. This approach ensures the validity of the data.

It is important to set this callback in case you work with remote item loading (ajax/api loading of options).

See the example ajax presenter, complete with input factory and user repository examples.

Ajax configuration can be very simple:

Supported and intended UI libraries

Selectoo uses "script engines" to generate JavaScript UI scripts along with HTML input element. Any script engine can be attached to the Selectoo instance by calling $selectoo->setEngine($engine).

Custom engines can easily be created implementing the ScriptEngineInterface interface.

Factories

For best reusability I strongly encourage using factories for inputs with more logic, typically these involve fetching data from storage or external resources along with JS/UI configuration, handling events and value validation.

See simple examples:

Script management

The scripts generated by engines can be post-processed and/or collected by a management routine. This approach can be used to gather and place the scripts at the end of the page and to solve problems when writing scripts inside the page and loading jQuery at the end of the HTML file.

See script-management example for more information.

Dependent selections / cascading inputs

Example is being prepared.

What is needed, in general:

Note that when the item callback is called the values from the Form object can be used to check for master values

By "master values" above I mean the values of the inputs the Selectoo instance depends on

By following these steps, dependent Selectoo inputs can be created and values validated.

Examples

Please see the examples included in the repository to get a better understanding of when Selectoo comes handy.

Notable differences compared to Nette SelectBox & MultiSelectBox

Requirements

Selectoo PHP Nette forms
version 2.0 7.1+ 3.*
version 1.0 7.0+ 2.4.*

You should also install Select2 version 4 to use the Select2Engine, see Select2 documentation.

You may install any other select input "skin" and implement your own engine for it within minutes.

Selectoo can also be used without such a "skin".


All versions of selectoo with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
nette/forms Version ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dakujem/selectoo contains the following files

Loading the files please wait ....