Backend\Modules\ContentBlocks\Form\ContentBlockType::getPossibleTemplates PHP Метод

getPossibleTemplates() приватный Метод

Get templates.
private getPossibleTemplates ( ) : array
Результат array
    private function getPossibleTemplates()
    {
        $templates = [];
        $finder = new Finder();
        $finder->name('*.html.twig');
        $finder->in(FRONTEND_MODULES_PATH . '/ContentBlocks/Layout/Widgets');
        // if there is a custom theme we should include the templates there also
        if ($this->currentTheme != 'core') {
            $path = FRONTEND_PATH . '/Themes/' . $this->currentTheme . '/Modules/ContentBlocks/Layout/Widgets';
            if (is_dir($path)) {
                $finder->in($path);
            }
        }
        foreach ($finder->files() as $file) {
            $templates[] = $file->getBasename();
        }
        $templates = array_unique($templates);
        return array_combine($templates, $templates);
    }