I have this code:
$fm = $app['assetic.filter_manager'];
$app['assetic.filter_manager'] = $app->share(
$app->extend('assetic.filter_manager', function($fm, $app) {
$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'
));
return $fm;
})
);
$app['assetic.asset_manager'] = $app->share(
$app->extend('assetic.asset_manager', function($am, $app) {
$am->set('styles', new Assetic\Asset\AssetCache(
new Assetic\Asset\GlobAsset(
__DIR__ . '/assetic/resources/css/*.css',
//this below is the line 50.
array($fm->get('yui_css'))
),
new Assetic\Cache\FilesystemCache(__DIR__ . '/assetic/cache')
));
$am->get('styles')->setTargetPath('css/styles');
return $am;
})
);
I'm getting this error:
PHP Notice: Undefined variable: fm in index.php on line 50
If I have defined the variable $fm, why am I getting this error?