source/Controller.php
public function actionIndex()
    {
        $this->showDescription();
        try {
            $component = $this->getComponent();
            $configList = $this->getConfig($component);
            $config = new Config([
                'files' => $configList,
            ]);
            $builder = new Builder([
                'components' => $config->getComponents(),
                'template' => require __DIR__ . '/template.php',
            ]);
            if ($component->result === null) {
                $component->result = ($this->getDetector()->detect() === 'basic') ?
                    '@app/_ide_components.php' :
                    '@console/../_ide_components.php';
            }
            $result = Yii::getAlias($component->result);
            $result = FileHelper::normalizePath($result);
            if ($builder->build($result)) {
                $this->stdout("Success: {$result}\n", Console::FG_GREEN);
            } else {
                $this->stdout("Fail!\n", Console::FG_RED);
            }
        } catch (Exception $exception) {
            $this->stdout($exception->getMessage() . "\n\n", Console::FG_RED);
            $this->stdout("Please read the package documentation: https://github.com/iiifx-production/yii2-autocomplete-helper\n");
            $this->stdout("or create new issue: https://github.com/iiifx-production/yii2-autocomplete-helper/issues/new\n");
        }
    }
public function actionIndex()
    {
        $this->showDescription();
        try {
            $component = $this->getComponent();
            $configList = $this->getConfig($component);
            $config = new Config([
                'files' => $configList,
            ]);
            $builder = new Builder([
                'components' => $config->getComponents(),
                'template' => require __DIR__ . '/template.php',
            ]);
            if ($component->result === null) {
                $component->result = ($this->getDetector()->detect() === 'basic') ?
                    '@app/_ide_components.php' :
                    '@console/../_ide_components.php';
            }
            $result = Yii::getAlias($component->result);
            $result = FileHelper::normalizePath($result);
            if ($builder->build($result)) {
                $this->stdout("Success: {$result}\n", Console::FG_GREEN);
            } else {
                $this->stdout("Fail!\n", Console::FG_RED);
            }
        } catch (Exception $exception) {
            $this->stdout($exception->getMessage() . "\n\n", Console::FG_RED);
            $this->stdout("Please read the package documentation: https://github.com/iiifx-production/yii2-autocomplete-helper\n");
            $this->stdout("or create new issue: https://github.com/iiifx-production/yii2-autocomplete-helper/issues/new\n");
        }
    }
public function actionIndex ( ) { $ this -> showDescription ( ) ; try { $ component = $ this -> getComponent ( ) ; $ configList = $ this -> getConfig ( $ component ) ; $ config = new Config ( [ 'files' => $ configList , ] ) ; $ builder = new Builder ( [ 'components' => $ config -> getComponents ( ) , 'template' => require __DIR__ . '/template.php' , ] ) ; if ( $ component -> result === null ) { $ component -> result = ( $ this -> getDetector ( ) -> detect ( ) === 'basic' ) ? '@app/_ide_components.php' : '@console/../_ide_components.php' ; } $ result = Yii :: getAlias ( $ component -> result ) ; $ result = FileHelper :: normalizePath ( $ result ) ; if ( $ builder -> build ( $ result ) ) { $ this -> stdout ( "Success: {$result}\n" , Console :: FG_GREEN ) ; } else { $ this -> stdout ( "Fail!\n" , Console :: FG_RED ) ; } } catch ( Exception $ exception ) { $ this -> stdout ( $ exception -> getMessage ( ) . "\n\n" , Console :: FG_RED ) ; $ this -> stdout ( "Please read the package documentation: https://github.com/iiifx-production/yii2-autocomplete-helper\n" ) ; $ this -> stdout ( "or create new issue: https://github.com/iiifx-production/yii2-autocomplete-helper/issues/new\n" ) ; } }
Generate IDE auto-completion file
Generate IDE auto - completion file