1. Go to this page and download the library: Download kreemer/ux-autocomplete-js 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/ */
kreemer / ux-autocomplete-js example snippets
// ...
use Kreemer\UX\AutoCompleteJS\Builder\AutoCompleteBuilderInterface;
class IndexController extends AbstractController
{
/**
* @Route("/", name="homepage")
*/
public function index(AutoCompleteBuilderInterface $autoCompleteBuilder): Response
{
$autoComplete = $autoCompleteBuilder->createAutocomplete();
$autoComplete->getDataModel()->setSrc([ 'here', 'are', 'the', 'options']);
return $this->render('index/index.html.twig', [
'autoComplete' => $autoComplete,
]);
}
}