1
我用CSS生成滿足問題生成CSS文件Symfony的2 assetic完全不
我加入這樣的代碼:
<? foreach ($asseticHelper->stylesheets(
array('@AnglerCoreBundle/Resources/public/css/*')
) as $url
): ?>
<link rel="stylesheet" href="<?= $view->escape($url) ?>" />
<? endforeach ?>
在我layout.html.php和頭:
<? foreach ($view['assetic']->javascripts(
array(
'@AnglerCoreBundle/Resources/public/js/framework/jquery.js',
'@AnglerCoreBundle/Resources/public/js/framework/json2.js',
'@AnglerBackendBundle/Resources/public/js/hashchange.js',
'@AnglerBackendBundle/Resources/public/js/location.js',
'@AnglerBackendBundle/Resources/public/js/interfaces/*',
'@AnglerBackendBundle/Resources/public/js/page.js',
'@AnglerBackendBundle/Resources/public/js/ui.js',
'@AnglerBackendBundle/Resources/public/js/main.js',
'@AnglerBackendBundle/Resources/public/js/fader.js',
'@AnglerBackendBundle/Resources/public/js/modal.js',
'@AnglerBackendBundle/Resources/public/js/pages/*',
)
) as $url
): ?>
以上關閉身體標記。問題是,當我打電話命令:
app/console clear:cache --env=dev[prod]
app/console assetic:dump
app/console assetic:dump --env=prod --no-debug
app/console assets:install
assetic束產生只有JavaScript和我看到他們的網頁上在兩個環境中,但CSS文件,它沒有。
夥計們!這是太棒了。 '應用程序/控制檯assetic:dump'沒有正確生成CSS文件,因爲我分配'$視圖[ 'assetic']'變量'$ asseticHelper'並試圖把這個:'$ asseticHelper->樣式表(...) '不要這樣做,至少對於需要一些控制檯操作的資產和所有幫助者來說 – setty