Download the PHP package iiifx-production/yii2-autocomplete-helper without Composer
On this page you can find all versions of the php package iiifx-production/yii2-autocomplete-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-autocomplete-helper
Yii2 IDE Autocomplete Helper
Autocompletion generator for custom components in Yii2.
[English documentation] [Документация на русском]
By default in Yii2 not working autocompletion for custom components. IDE sees no added components and this causes inconvenience in operation.
This extension allows you to automatically generate a file with the autocomplete PHPDoc blocks with which the IDE will recognize all of the components in the application configuration.
Installation
Using Composer:
Configuration
After installation, you need to one-time set up component to work.
For Yii2 Basic, in @app/config/console.php:
For Yii2 Advanced, in @console/config/main.php:
Using
To generate autocompletion in the console:
Generator automatically detects the type of application, read all configuration files and generate the autocomplete file to the application root.
Important: For IDE did not swear on the two copies of the Yii class must be main Yii class file marked as a text document - example. The main class is located on the way: @vendor/yiisoft/yii2/Yii.php
Advanced customization
Sometimes the structure of the application differs from the standard and the need to change the generator behavior.
The following are examples of possible configuration options.
Changing the name of the component
If you need to change the name of a autocomplete to another, it is quite simple:
When the generator run in the console you need to pass the correct component name:
Changing environment
By default, a generator start is only possible for YII_ENV = "dev" environment.
You can change the environment:
Changing the generator controller
By default, the generator uses a console controller to create autocompletion.
You can replace the default controller, extend it, or add your own implementation:
Now you can run your controller:
Link to the controller by default: source/Controller.php.
Changing the autocompletion file
By default, autocompletion file will be named _ide_components.php and will be placed in the application root.
You can change the name and location of the file:
The file path must be relative to aliases framework. Example: @common/../new-file-name.php.
Special configuration files
Sometimes you need to manually specify the application configuration files from which you want to generate autocompletion.
In this case, the generator will not seek configuration, the generator immediately uses this list.
For Yii2 Advanced:
For Yii2 Basic:
Configuration groups
In big projects sometimes need to be able to generate different autocomplete files depending on the stage of development.
You can group configuration files and generate autocompletion only for a specific group.
Now you can generate autocompletion for the desired group:
Configuring Application Classes
Some projects can sometimes use overridden application classes for web and console.
You can do this through the appropriate setting in the config.