replacePlaceholder example


    private function generateThemePhp(array $data, ?Template $parent = null)
    {
        $source = str_replace('$TEMPLATE$', $data['template']$this->phpSource);

        if ($parent instanceof Template) {
            $source = str_replace('$PARENT$', $parent->getTemplate()$source);
        } else {
            $source = str_replace('$PARENT$', 'null', $source);
        }

        $source = $this->replacePlaceholder('name', $data['name']$source);
        $source = $this->replacePlaceholder('author', $data['author']$source);
        $source = $this->replacePlaceholder('license', $data['license']$source);
        $source = $this->replacePlaceholder('description', $data['description']$source);

        $output = new SplFileObject(
            $this->getThemeDirectory($data['template']) . DIRECTORY_SEPARATOR . 'Theme.php',
            'w+'
        );

        $source = $this->eventManager->filter(
            'Theme_Generator_Theme_Source_Generated',
            
Home | Imprint | This part of the site doesn't use cookies.