#AutoComplete field add-on for Agile Toolkit 4.3+
This will replace standard drop-down field with an auto-complete field.
- PHP >=5.4
- ATK4 >=4.3
The recommended way to install this add-on is through Composer.
# Install Composer
curl -sS https://getcomposer.org/installer | php
Next, update your project's composer.json file to include AutoComplete:
{
"require": {
"darkside666/autocomplete": "dev-master"
}
}
In your Frontend->init() add following lines:
// allow add-ons to reside in /vendor folder
$this->addLocation(['addons' => ['../vendor']])
->setBasePath($this->pathfinder->base_location->getPath());
// HACK: force call Initiator of all used add-ons :)
foreach (['darkside666/autocomplete'] as $addon) {
$this->add("$addon\Initiator");
}
And then you're ready to use this add-on like this:
// In model
$model->hasOne('User')->display(['form'=>'darkside666/autocomplete/Basic']);
// Or directly in form
$field = $form->addField('darkside666/autocomplete/Basic');
$field->setModel('User');