getAdditionalBundles example


    final public function getBundles(array $kernelParameters = [], array $loadedBundles = []): iterable
    {
        if (!$this->initialized) {
            return;
        }

        foreach ($this->pluginInstances->getActives() as $plugin) {
            $copy = new KernelPluginCollection($this->getPluginInstances()->all());
            $additionalBundleParameters = new AdditionalBundleParameters($this->classLoader, $copy$kernelParameters);
            $additionalBundles = $plugin->getAdditionalBundles($additionalBundleParameters);
            [$preLoaded$postLoaded] = $this->splitBundlesIntoPreAndPost($additionalBundles);

            foreach ([...\array_values($preLoaded)$plugin, ...\array_values($postLoaded)] as $bundle) {
                if (!\in_array($bundle->getName()$loadedBundles, true)) {
                    yield $bundle;
                    $loadedBundles[] = $bundle->getName();
                }
            }
        }

        if (!\in_array($this->getName()$loadedBundles, true)) {
            
/** * @throws PluginNotFoundException */
    public function copyAssetsFromBundle(string $bundleName, bool $force = false): void
    {
        $bundle = $this->getBundle($bundleName);

        $this->copyAssets($bundle$force);

        if ($bundle instanceof Plugin) {
            foreach ($this->getAdditionalBundles($bundle) as $bundle) {
                $this->copyAssets($bundle$force);
            }
        }
    }

    public function copyAssets(BundleInterface $bundle, bool $force = false): void
    {
        $this->copyAssetsFromBundleOrApp(
            $bundle->getPath() . '/Resources/public',
            $bundle->getName(),
            $force
        );
Home | Imprint | This part of the site doesn't use cookies.