Bolt\Extension\AssetTrait::extendAssetServices PHP Method

extendAssetServices() final protected method

Call this in register method.
final protected extendAssetServices ( )
    protected final function extendAssetServices()
    {
        /** @var Application $app */
        $app = $this->getContainer();
        $app['asset.queue.file'] = $app->share($app->extend('asset.queue.file', function ($queue) {
            $this->loadAssets();
            foreach ($this->assets as $asset) {
                if ($asset instanceof FileAssetInterface) {
                    $queue->add($asset);
                }
            }
            return $queue;
        }));
        $app['asset.queue.snippet'] = $app->share($app->extend('asset.queue.snippet', function ($queue) {
            $this->loadAssets();
            foreach ($this->assets as $asset) {
                if ($asset instanceof SnippetAssetInterface) {
                    $queue->add($asset);
                }
            }
            return $queue;
        }));
        $app['asset.queue.widget'] = $app->share($app->extend('asset.queue.widget', function ($queue) {
            $this->loadAssets();
            foreach ($this->assets as $asset) {
                if ($asset instanceof WidgetAssetInterface) {
                    $queue->add($asset);
                }
            }
            return $queue;
        }));
    }