PHP code example of dakujem / selectoo

1. Go to this page and download the library: Download dakujem/selectoo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dakujem / selectoo example snippets


$items = ['a', 'b', 'c', 'd',];
$input = new Selectoo($label, $items, $multiselect);

$input = new Selectoo($label, [$repository, 'fetchAll'], $multiselect);

$input->setEngine(new Select2Engine);

$input->getEngine()

	->placeholder('Select a user', true)
	->width('width: 100%', true)
	->closeOnSelect(false, true)

;

(new Select2Engine())
	->ajax('{url: "' . $link . '", dataType: "json" }')
;