Bolt\Config::parseTheme PHP Method

parseTheme() protected method

Read and parse the current theme's config.yml configuration file.
protected parseTheme ( string $themePath, array $generalConfig ) : array
$themePath string
$generalConfig array
return array
    protected function parseTheme($themePath, array $generalConfig)
    {
        $themeConfig = $this->parseConfigYaml('theme.yml', $themePath);
        /** @deprecated Deprecated since 3.0, to be removed in 4.0. (config.yml was the old filename) */
        if (empty($themeConfig)) {
            $themeConfig = $this->parseConfigYaml('config.yml', $themePath);
        }
        if (isset($themeConfig['templatefields']) && is_array($themeConfig['templatefields'])) {
            $templateContentTypes = [];
            foreach ($themeConfig['templatefields'] as $template => $templateFields) {
                $fieldsContenttype = ['fields' => $templateFields, 'singular_name' => 'Template Fields ' . $template];
                try {
                    $templateContentTypes[$template] = $this->parseContentType($template, $fieldsContenttype, $generalConfig);
                } catch (InvalidArgumentException $e) {
                    $this->exceptions[] = $e->getMessage();
                }
            }
            $themeConfig['templatefields'] = $templateContentTypes;
        }
        return $themeConfig;
    }