Download the PHP package heimrichhannot/contao-autocompletejs-bundle without Composer

On this page you can find all versions of the php package heimrichhannot/contao-autocompletejs-bundle. 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 contao-autocompletejs-bundle

Contao autoCompleteJs Bundle

This bundle offers support for the JavaScript library autoComplete.js for the Contao CMS.

Features

Installation

Install via composer: composer require heimrichhannot/contao-autocompletejs-bundle and update your database.

Usage

Active or deactivate autocompletejs support on page level (Layout section). You can overwrite settings from a parent page.

DCA configuration

To activate autocompletejs on a dca field add

Add autocompletejs configuration to the eval array of dca field :

Example: load data from an API

Return value of the api must be an array of objects. The object keys defined in data.keys will be used to display the results.

Configuration options

Option name Type Value
data Array type, url, key, cache
data.url String url to be fetched for data
data.src Array array of values if autocomplete options are static values
data.keys Array keys of the data array if available
data.cache Boolean cache the input, must be 'false' if data.type is a function
searchEngine String 'strict', 'loose' or 'none'
placeHolder String placeholder of the input field
selector String id of the input field
threshold Integer minimum number of characters to trigger autocomplete
debounce Integer idle time after entering new character (milliseconds)
maxResults Integer maximum number of results shown in the dropdown menu
highlight Boolean show entered characters in the results dropdown menu

You can also set all options of the library (see more).

Custom configuration values

This bundle has a new value for searchEngine option : 'none'

Set searchEngine : 'none' if no search algorithm should be applied to the result list. This comes handy if your results are allready searched(eg. result list from an API)

Events

Event name Description
CustomizeAutocompletejsOptionsEvent Used to modify options provided from dca

JavaScript Events

Following events can be used to further customize the autocompletejs instances:

Event name Data Description
huh.autocompletejs.adjust_result_item field, item Customize matched Item in the dropdown menu (resultItem configuration option of the autoComplete object)
huh.autocompletejs.onselection source, data Customize selection behavior of selected Item (onSelection configuration options of the autoComplete object)

!!!Caution!!! Known limitations

When fetching data via Controller make sure returning array is numerically consecutive indexed. Or if key option is used the array should not be numerically indexed at all. The JSON should never looks like this:


All versions of contao-autocompletejs-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
contao/core-bundle Version ^4.9
heimrichhannot/contao-encore-contracts Version ^1.0
heimrichhannot/contao-utils-bundle Version ^2.177
symfony/deprecation-contracts Version ^1.0 || ^2.0 || ^3.0
symfony/event-dispatcher-contracts Version ^1.0 || ^2.0 || ^3.0
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 heimrichhannot/contao-autocompletejs-bundle contains the following files

Loading the files please wait ....