Closed jhuet closed 11 years ago
You should cache the "images" directory as explain in simple-configuration-example
'assets' => array(
'css' => array(
'css/bootstrap.min.css',
'css/style.css',
'css/bootstrap-responsive.min.css',
),
'media' => array('images')
)
Sorry, i should have given you the whole config file but it is. Here's the whole file :
<?php
return array(
'asset_bundle' => array(
'cachePath' => '@zfRootPath/public/assets/cache',//cache directory absolute path
'assets' => array(
'css' => array(
'css/bootstrap.css',
'css/style.css',
'css/bootstrap-responsive.css',
),
'js' => array(
'js/jquery.min.js',
'js/bootstrap.js'
),
'media' => array('images'),
'less' => array('@zfRootPath/vendor/twitter/bootstrap/less/bootstrap.less')
)
),
);
And here's how my cache directory looks like for dev :
cache | - images | - | - zf-2-logo.png | - css_bootstrap.css | - css_bootstrap-responsive.css | - css_style.css | - dev_9260a6ead8b3303de4e2c6ea553f8b0f.css | - dev_9260a6ead8b3303de4e2c6ea553f8b0f.less | - js_bootstrap.js | - js_jquery.min.js
Css and js files aren't in a css
and js
directory thus breaking relative paths.
I think I've fixed your issue, could you please test it ?
I'm having an issue with the css rule in the ZF2 Skeleton that displays the logo as a background image :
It relates to the path image relatively to the where the css file is. But as all css files are stored at the root of the cache directory - either in production or in dev if you specify them in a specific order like this :
It won't find the image anymore as the final path will be :
/assets/images/zf2-logo.png
instead of/assets/cache/images/zf2-logo.png