Skip to content
Browse files

Examples are now PSR-2 compliant.

  • Loading branch information...
1 parent fb92651 commit 1aee0b7f70ae6487346641af5f6cdd2bc9dae3af @ThePixelDeveloper ThePixelDeveloper committed Dec 23, 2012
Showing with 55 additions and 33 deletions.
  1. +55 −33 example/assetic.php
View
88 example/assetic.php
@@ -2,42 +2,64 @@
$app = new Silex\Application();
-$app->register(new Silex\Extension\TwigExtension(), array(
- 'twig.class_path' => __DIR__ . '/../vendor/twig/lib',
- 'twig.path' => __DIR__ . '/twig'
-));
+$app->register(
+ new Silex\Extension\TwigExtension(),
+ array(
+ 'twig.class_path' => __DIR__ . '/../vendor/twig/lib',
+ 'twig.path' => __DIR__ . '/twig'
+ )
+);
$app['autoloader']->registerNamespace('SilexAssetic', __DIR__ . '/../src');
-$app->register(new SilexAssetic\AsseticExtension(), array(
- 'assetic.class_path' => __DIR__.'/../vendor/assetic/src',
- 'assetic.path_to_web' => __DIR__ . '/assetic/output',
- 'assetic.options' => array(
- 'formulae_cache_dir' => __DIR__ . '/assetic/cache',
- 'debug' => false
- ),
- 'assetic.filters' => $app->protect(function($fm) {
- $fm->set('yui_css', new Assetic\Filter\Yui\CssCompressorFilter(
- '/usr/share/yui-compressor/yui-compressor.jar'
- ));
- $fm->set('yui_js', new Assetic\Filter\Yui\JsCompressorFilter(
- '/usr/share/yui-compressor/yui-compressor.jar'
- ));
- }),
- 'assetic.assets' => $app->protect(function($am, $fm) {
- $am->set('styles', new Assetic\Asset\AssetCache(
- new Assetic\Asset\GlobAsset(
- __DIR__ . '/assetic/resources/css/*.css',
- array($fm->get('yui_css'))
- ),
- new Assetic\Cache\FilesystemCache(__DIR__ . '/assetic/cache')
- ));
- $am->get('styles')->setTargetPath('css/styles');
- })
-));
+$app->register(
+ new SilexAssetic\AsseticExtension(),
+ array(
+ 'assetic.class_path' => __DIR__.'/../vendor/assetic/src',
+ 'assetic.path_to_web' => __DIR__ . '/assetic/output',
+ 'assetic.options' => array(
+ 'formulae_cache_dir' => __DIR__ . '/assetic/cache',
+ 'debug' => false
+ ),
+ 'assetic.filters' => $app->protect(
+ function ($fm) {
+ $fm->set(
+ 'yui_css',
+ new Assetic\Filter\Yui\CssCompressorFilter(
+ '/usr/share/yui-compressor/yui-compressor.jar'
+ )
+ );
+ $fm->set(
+ 'yui_js',
+ new Assetic\Filter\Yui\JsCompressorFilter(
+ '/usr/share/yui-compressor/yui-compressor.jar'
+ )
+ );
+ }
+ ),
+ 'assetic.assets' => $app->protect(
+ function ($am, $fm) {
+ $am->set(
+ 'styles',
+ new Assetic\Asset\AssetCache(
+ new Assetic\Asset\GlobAsset(
+ __DIR__ . '/assetic/resources/css/*.css',
+ array($fm->get('yui_css'))
+ ),
+ new Assetic\Cache\FilesystemCache(__DIR__ . '/assetic/cache')
+ )
+ );
+ $am->get('styles')->setTargetPath('css/styles');
+ }
+ )
+ )
+);
-$app->get('/', function () use ($app) {
- return "Hello!";
-});
+$app->get(
+ '/',
+ function () use ($app) {
+ return "Hello!";
+ }
+);
$app->run();

0 comments on commit 1aee0b7

Please sign in to comment.
Something went wrong with that request. Please try again.