public function selectModule(array $options = [])
    {
        $modules = [];
        foreach (Yii::$app->getModules() as $id => $object) {
            if (!$object instanceof \luya\base\Module) {
                continue;
            }
            if (isset($options['onlyAdmin']) && $options['onlyAdmin']) {
                if (!$object instanceof AdminModuleInterface) {
                    continue;
                }
            }
    
            if (isset($options['hideCore']) && $options['hideCore']) {
                if ($object instanceof CoreModuleInterface) {
                    continue;
                }
            }
            $modules[$id] = $id;
        }
    
        $text = (isset($options['text'])) ? $options['text'] : 'Please select a module:';
    
        return $this->select($text, $modules);
    }
public function selectModule(array $options = [])
    {
        $modules = [];
        foreach (Yii::$app->getModules() as $id => $object) {
            if (!$object instanceof \luya\base\Module) {
                continue;
            }
            if (isset($options['onlyAdmin']) && $options['onlyAdmin']) {
                if (!$object instanceof AdminModuleInterface) {
                    continue;
                }
            }
    
            if (isset($options['hideCore']) && $options['hideCore']) {
                if ($object instanceof CoreModuleInterface) {
                    continue;
                }
            }
            $modules[$id] = $id;
        }
    
        $text = (isset($options['text'])) ? $options['text'] : 'Please select a module:';
    
        return $this->select($text, $modules);
    }
public function selectModule ( array $ options = [ ] ) { $ modules = [ ] ; foreach ( Yii :: $ app -> getModules ( ) as $ id => $ object ) { if ( ! $ object instanceof \ luya \ base \ Module ) { continue ; } if ( isset ( $ options [ 'onlyAdmin' ] ) && $ options [ 'onlyAdmin' ] ) { if ( ! $ object instanceof AdminModuleInterface ) { continue ; } } if ( isset ( $ options [ 'hideCore' ] ) && $ options [ 'hideCore' ] ) { if ( $ object instanceof CoreModuleInterface ) { continue ; } } $ modules [ $ id ] = $ id ; } $ text = ( isset ( $ options [ 'text' ] ) ) ? $ options [ 'text' ] : 'Please select a module:' ; return $ this -> select ( $ text , $ modules ) ; }
Get selection list for console commands with defined options.

@param array $options Define behavior of the module selector prompt, options are name-value pairs. The following options are available:

- onlyAdmin: boolean, if enabled all not admin modules will not be included
- hideCore: boolean, if enabled all core modules (from luya dev team) will be hidden.

@return string The name (ID) of the selected module.
Get selection list for console commands with defined options .