dotsunited/bundlefu-silex-service-provider

Silex service provider for BundleFu

Maintainers

👁 jsor

Package info

github.com/dotsunited/BundleFuSilexServiceProvider

pkg:composer/dotsunited/bundlefu-silex-service-provider

Statistics

Installs: 949

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2015-02-06 11:19 UTC

Requires

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT acae632178bb619e6e490426a820a06af7bccfc7

silexjavascriptcssbundlingassetserviceprovider

This package is auto-updated.

Last update: 2026-06-05 22:00:55 UTC


README

👁 Build Status

The BundleFuSilexServiceProvider integrates BundleFu into the Silex micro-framework.

Installation

BundleFuSilexServiceProvider can be installed using the Composer tool. You can either add dotsunited/bundlefu-silex-service-provider to the dependencies in your composer.json, or if you want to install BundleFuSilexServiceProvider as standalone, go to the main directory and run:

$ wget http://getcomposer.org/composer.phar 
$ php composer.phar install

You can then use the composer-generated autoloader to access the BundleFuSilexServiceProvider classes:

<?php
require 'vendor/autoload.php';
?>

Usage

Register the BundleFuServiceProvider to your Silex application:

<?php
$app = new \Silex\Application();

$app->register(new DotsUnited\BundleFu\Silex\BundleFuServiceProvider());
?>

You can now use the bundlefu.factory service to create bundles in your application:

<?php
$bundle = $app['bundlefu.factory']->createBundle();
?>

To configure the factory, you can pass the bundlefu.options and bundlefu.filters parameters:

<?php
$app->register(new DotsUnited\BundleFu\Silex\BundleFuServiceProvider(), array(
 'bundlefu.options' => array(
 'bypass' => true
 ),
 'bundlefu.filters' => array(
 'js_closure_compiler' => new \DotsUnited\BundleFu\Filter\ClosureCompilerService()
 )
));
?>

Twig

The service provider automatically registers the BundleFu twig extension if Twig is available (ensure that you register the BundleFuServiceProvider after the TwigServiceProvider in your application).

If do not want the extension to be registered, set bundlefu.twig.extension with the value false as a parameter:

<?php
$app->register(new DotsUnited\BundleFu\Silex\BundleFuServiceProvider(), array(
 'bundlefu.twig.extension' => false
));
?>

License

BundleFuSilexServiceProvider is released under the MIT License.