shopware 5 plugin theme_less_collection code example

Example 1: shopware 5 plugin theme_less_collection

public function addLessFiles(\Enlight_Event_EventArgs $args)
    {
        $less = new \Shopware\Components\Theme\LessDefinition(
        //configuration
        array(),
    
            //less files to compile
            array(
                __DIR__ . '/Resources/views/frontend/less/all.less'
            ),
    
            //import directory
            __DIR__
        );
    
        return new Doctrine\Common\Collections\ArrayCollection(array($less));
    }

Example 2: shopware 5 plugin theme_less_collection

public static function getSubscribedEvents()
    {
      return [
        'Enlight_Controller_Action_PostDispatchSecure_Frontend' => 'onFrontendPostDispatch',
        'Theme_Compiler_Collect_Plugin_Less' => 'addLessFiles',
      ];
    }

Tags:

Misc Example