getExtend example


    private function injectConfig(Theme $theme, TabContainer $container): void
    {
        // Check if theme wants to inject parent configuration         if (!$theme->useInheritanceConfig() || $theme->getExtend() === null) {
            return;
        }

        $template = $this->repository->findOneBy([
            'template' => $theme->getTemplate(),
        ]);

        // No parent configured? cancel injection.         if (!$template instanceof Template || !$template->getParent() instanceof Template) {
            return;
        }

        
/** * Helper function which resolves the theme parent for each * passed theme * * @throws Exception */
    private function setParents(array $themes)
    {
        /** @var Theme $theme */
        foreach ($themes as $theme) {
            if ($theme->getExtend() === null) {
                continue;
            }

            $template = $this->repository->findOneBy([
                'template' => $theme->getTemplate(),
            ]);
            if (!$template instanceof Template) {
                throw new Exception(sprintf('Template of theme %s not found', $theme->getTemplate()));
            }

            $parent = $this->repository->findOneBy([
                
Home | Imprint | This part of the site doesn't use cookies.