The theme can be chosen in various ways.

@return Generator
328218
private function themes(): Generator
    {
        $themes = $this->module_service->findByInterface(ModuleThemeInterface::class);

        // Last theme used
        yield $themes->get(Session::get('theme', ''));

        // Default for tree
        $tree = app(Tree::class);

        if ($tree instanceof Tree) {
            yield $themes->get($tree->getPreference('THEME_DIR'));
        }

        // Default for site
        yield $themes->get(Site::getPreference('THEME_DIR'));

        // Default for application
        yield app(WebtreesTheme::class);
    }
550637
public function layers() : Generator
    {
        yield $this->input;
        
        foreach ($this->hidden as $hidden) {
            yield $hidden;
        }

        yield $this->output;
    }
771478
public function getPageGenerators()
    {
        if (!is_null($this->_pageGenerators)) return $this->_pageGenerators;

        $cacheId = $this->componentClass . '_pageGenerators';

        $generators = Kwf_Cache_SimpleStatic::fetch($cacheId);
        if (!$generators) {
            $generators = array();
            foreach (Kwc_Abstract::getComponentClasses() as $class) {
                foreach (Kwc_Abstract::getSetting($class, 'generators') as $key => $generator) {
                    if (!isset($generator['class'])) {
                        throw new Kwf_Exception("no generator class set for generator '$key' in component '$class'");
                    }
                    if (is_instance_of($generator['class'], 'Kwc_Root_Category_Generator')) {
                        $generators[] = array('class' => $class, 'key' => $key, 'generator' => $generator);
                    }
                }
            }
            Kwf_Cache_SimpleStatic::add($cacheId, $generators);
        }

        $this->_pageGenerators = array();
        foreach ($generators as $g) {
            $this->_pageGenerators[] = Kwf_Component_Generator_Abstract::getInstance(
                $g['class'], $g['key'], $g['generator']
            );
        }
        return $this->_pageGenerators;
    }
93925
protected function createGenerator()
    {
        $filesystem = $this->getContainer()->get('filesystem');
        $registry = $this->getContainer()->get('doctrine');

        return new DefaultPagePartGenerator($filesystem, $registry, '/pagepart', $this->assistant, $this->getContainer());
    }
1167791
public function generateResources()
    {
        app('Luthfi\CrudGenerator\Generators\LangFileGenerator', ['command' => $this])->generate();
        app('Luthfi\CrudGenerator\Generators\FormViewGenerator', ['command' => $this])->generate();
        app('Luthfi\CrudGenerator\Generators\IndexViewGenerator', ['command' => $this])->generate();
        app('Luthfi\CrudGenerator\Generators\ShowViewGenerator', ['command' => $this])->generate();
    }
157063
protected function createGenerator()
    {
        $filesystem = $this->getContainer()->get('filesystem');
        $registry = $this->getContainer()->get('doctrine');

        return new PageGenerator($filesystem, $registry, '/page', $this->assistant, $this->getContainer());
    }
416402
public function generate()
	{
		if (TL_MODE == 'FE' && !BE_USER_LOGGED_IN && ($this->invisible || ($this->start > 0 && $this->start > time()) || ($this->stop > 0 && $this->stop < time())))
		{
			return '';
		}

		if ($this->arrData['space'][0] != '')
		{
			$this->arrStyle[] = 'margin-top:'.$this->arrData['space'][0].'px;';
		}

		if ($this->arrData['space'][1] != '')
		{
			$this->arrStyle[] = 'margin-bottom:'.$this->arrData['space'][1].'px;';
		}

		$this->Template = new \FrontendTemplate($this->strTemplate);
		$this->Template->setData($this->arrData);

		$this->compile();

		$this->Template->style = !empty($this->arrStyle) ? implode(' ', $this->arrStyle) : '';
		$this->Template->class = trim('ce_' . $this->type . ' ' . $this->cssID[1]);
		$this->Template->cssID = ($this->cssID[0] != '') ? ' id="' . $this->cssID[0] . '"' : '';

		$this->Template->inColumn = $this->strColumn;

		if ($this->Template->headline == '')
		{
			$this->Template->headline = $this->headline;
		}

		if ($this->Template->hl == '')
		{
			$this->Template->hl = $this->hl;
		}

		return $this->Template->parse();
	}
975585
protected function registerTheme()
    {
        $this->app->singleton('antares.theme', function ($app) {
            return new ThemeManager($app);
        });

        $this->app->singleton('antares.theme.finder', function ($app) {
            return new Finder($app);
        });
    }
1276757
public function generate()
    {
        $this->loadWebMasterTags();

        $title       = $this->getTitle();
        $description = $this->getDescription();
        $keywords    = $this->getKeywords();
        $metatags    = $this->metatags;

        $html   = [];

        if($title):
            $html[] = "<title>$title</title>";
        endif;

        if(!empty($description)):
            $html[] = "<meta name=\"description\" content=\"{$description}\" />";
        endif;

        if (!empty($keywords)):
            $keywords = implode(',', $keywords);
            $html[]   = "<meta name=\"keywords\" content=\"{$keywords}\" />";
        endif;

        foreach ($metatags as $key => $value):
            $name    = $value[0];
            $content = $value[1];
            $html[]  = "<meta {$name}=\"{$key}\" content=\"{$content}\" />";
        endforeach;

        return implode(PHP_EOL, $html);
    }
940977
private function getAllGenerators() {
        $allGenerators = array();
        foreach (fphp\Generator\Generator::getGeneratorMap() as $key => $klass)            
            $allGenerators[$key] = new $klass($this->productLine->getGeneratorSettings($key));
        return $allGenerators;
    }
315358
protected function _getRandomGenerator()
    {
        return $this->_randomizer ? $this->_randomizer->getArrayValue($this->_generators) : $this->_generators[array_rand($this->_generators)];
    }
535182
protected function generateTheme()
    {
        $nodes = $this->xpath->query('/x:webspace/x:theme/x:key');
        if ($nodes->length > 0) {
            return $nodes->item(0)->nodeValue;
        }

        $nodes = $this->xpath->query('/x:webspace/x:theme');
        if (0 === $nodes->length) {
            return;
        }

        return $nodes->item(0)->nodeValue;
    }
944237
private function getDefaultGenerator()
    {
        foreach (self::$defaultGenerators as $generator) {
            /** @var Generator\Generator $generator */
            $generator = new $generator();

            if ($generator->isSupported()) {
                return $generator;
            }
        }

        throw new GeneratorException('Default secure random byte generators are not supported by the system');
    }
153208
public function configureSequence(): \Generator
    {
        $sequence = $this->config['configure'] ?? $this->config['configureSequence'] ?? [];
        foreach ($sequence as $item) {
            yield $this->parseSequence($item);
        }
    }
77200
public function getThemeAttribute()
    {
        if ($this->themeCache !== null) {
            return $this->themeCache;
        }

        $themeName = $this->getDatasourceName()
            ?: static::getDatasourceResolver()->getDefaultDatasource();

        return $this->themeCache = Theme::load($themeName);
    }
1239970
public static function themes()
    {
        $themesUri = self::root() . '/style/';
        $themes = array();
        foreach (glob($themesUri . '/*.css') as $css) {
            $fn = trim(preg_replace("%.*/%", '', $css));
            switch ($fn) {
                // these are special, exclude these
                case 'luminous.css':
                case 'luminous_print.css':
                case 'luminous.min.css':
                    continue;
                default:
                    $themes[] = $fn;
            }
        }
        return $themes;
    }
54528
public function getGenerator()
    {
        if (!$this->generator) {
            $this->generator = Factory::create($this->locale);
        }

        return $this->generator;
    }