src/Field.php
private function _getCustomConfigOptions(string $dir): array
    {
        $options = ['' => Craft::t('redactor', 'Default')];
        $path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir;

        if (is_dir($path)) {
            $files = FileHelper::findFiles($path, [
                'only' => ['*.json'],
                'recursive' => false
            ]);

            foreach ($files as $file) {
                $options[pathinfo($file, PATHINFO_BASENAME)] = pathinfo($file, PATHINFO_FILENAME);
            }
        }

        return $options;
    }
private function _getCustomConfigOptions(string $dir): array
    {
        $options = ['' => Craft::t('redactor', 'Default')];
        $path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir;

        if (is_dir($path)) {
            $files = FileHelper::findFiles($path, [
                'only' => ['*.json'],
                'recursive' => false
            ]);

            foreach ($files as $file) {
                $options[pathinfo($file, PATHINFO_BASENAME)] = pathinfo($file, PATHINFO_FILENAME);
            }
        }

        return $options;
    }
private function _getCustomConfigOptions ( string $ dir ) : array { $ options = [ '' => Craft :: t ( 'redactor' , 'Default' ) ] ; $ path = Craft :: $ app -> getPath ( ) -> getConfigPath ( ) . DIRECTORY_SEPARATOR . $ dir ; if ( is_dir ( $ path ) ) { $ files = FileHelper :: findFiles ( $ path , [ 'only' => [ '*.json' ] , 'recursive' => false ] ) ; foreach ( $ files as $ file ) { $ options [ pathinfo ( $ file , PATHINFO_BASENAME ) ] = pathinfo ( $ file , PATHINFO_FILENAME ) ; } } return $ options ; }
Returns the available Redactor config options.

@param string $dir The directory name within the config/ folder to look for config files
@return array
Returns the available Redactor config options .