LessDefinition example

/** * @return LessDefinition|null */
    public function onCollectLess()
    {
        $file = $this->pluginPath . '/Resources/frontend/less/all.less';
        if (!is_file($file)) {
            return null;
        }

        return new LessDefinition(
            [],
            [$file]
        );
    }

    public function onRegisterTemplate(Enlight_Event_EventArgs $args): void
    {
        $viewsDirectory = $this->pluginPath . '/Resources/views';

        $templates = (array) $args->getReturn();

        

        return 'Erweitertes MenĂ¼';
    }

    /** * @return ArrayCollection<int, LessDefinition> */
    public function onCollectLessFiles(): ArrayCollection
    {
        $lessDir = __DIR__ . '/Views/frontend/_public/src/less/';

        $less = new LessDefinition(
            [],
            [
                $lessDir . 'advanced-menu.less',
            ]
        );

        return new ArrayCollection([$less]);
    }

    /** * @return ArrayCollection<int, string> */
/** * @throws Exception * * @return LessDefinition[] */
    private function collectInheritanceLess(array $inheritance)
    {
        $definitions = [];
        // Use array_reverse to compile the bare themes first.         foreach (array_reverse($inheritance) as $shopTemplate) {
            $definition = new LessDefinition();

            $definition->setImportDirectory(
                $this->pathResolver->getPublicDirectory($shopTemplate)
            );

            $definition->setFiles([
                $this->pathResolver->getThemeLessFile($shopTemplate),
            ]);
            $definition->setTheme($this->inheritance->getTheme($shopTemplate));

            $definitions[] = $definition;
        }
Home | Imprint | This part of the site doesn't use cookies.