getThemeConfigTemplate example



        $bootstrap = str_replace(
            ['#namespace#', '#class#'],
            [$pluginName$pluginName],
            $this->getBootstrapTemplate()
        );

        $themeConfig = str_replace(
            ['#name#', '#snake-case#'],
            [$themeName$snakeCaseName],
            $this->getThemeConfigTemplate()
        );

        file_put_contents($composerFile$composer);
        file_put_contents($bootstrapFile$bootstrap);
        file_put_contents($themeConfigFile$themeConfig);
        file_put_contents($variableOverridesFile$this->getVariableOverridesTemplate());

        touch($directory . '/src/Resources/app/storefront/src/assets/.gitkeep');
        touch($directory . '/src/Resources/app/storefront/src/scss/base.scss');
        touch($directory . '/src/Resources/app/storefront/src/main.js');
        touch($directory . '/src/Resources/app/storefront/dist/storefront/js/' . $snakeCaseName . '.js');

        
$manifestContent = $this->replaceTemplateValues(
            $this->getManifestTemplate(),
            $details
        );

        $this->createDirectory($appDirectory);

        file_put_contents($appDirectory . '/manifest.xml', $manifestContent);

        if ($createThemeConfig) {
            $manifestContent = $this->replaceTemplateValues(
                $this->getThemeConfigTemplate(),
                [
                    'name' => $details['name'],
                    'author' => $details['author'],
                    'name-snake-case' => (new CamelCaseToSnakeCaseNameConverter())->normalize($details['name']),
                ]
            );

            $this->createDirectory($appDirectory . '/Resources');

            file_put_contents($appDirectory . '/Resources/theme.json', $manifestContent);
        }
    }
Home | Imprint | This part of the site doesn't use cookies.