我正在使用 jQuery-ui datepicker,但图像和路径有问题。这就是我链接我的CSS的方式:
{% stylesheets '@BackendBundle/Resources/public/css/bootstrap.min.css'
'@BackendBundle/Resources/public/css/bootstrap-responsive.min.css'
'@HotelBundle/Resources/public/css/ui-lightness/jquery-ui-1.8.20.custom.css'
'@HotelBundle/Resources/public/css/encargado.css'
output='css/encargado.css' %}
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
{% endstylesheets %}
{% endblock %}
{% block javascripts %}
{% javascripts '@BackendBundle/Resources/public/js/jquery-1.7.2.min.js'
'@BackendBundle/Resources/public/js/modernizr-2.5.3-respond-1.1.0.min.js'
'@HotelBundle/Resources/public/js/jquery-ui-1.8.20.custom.min.js'
output='js/backend.js' %}
<script src="{{ asset_url }}" type="text/javascript"></script>
{% endjavascripts %}
我将我的文件 css 文件保存在那里:
../src/Gitek/HotelBundle/Resources/public/css/ui-lightness/
- jquery-ui-1.8.20.custom.css
- images/ui-bg_diagonals-thick_18_b81900_40x40.png;ui-bg_diagonals-thick_20_666666_40x40.png ...
我的js文件在那里:
../src/Gitek/HotelBundle/Resources/public/js/jquery-ui-1.8.20.custom.min.css
之后,我用 php app/consoleassetic:dump 转储资产,没有错误
我还使用 php app/console assets 安装资产:install web --symlink
并清除缓存 php app/console cache:clear
我做了所有这些,我可以看到并使用我的日期选择器,但有些图片没有加载。如果我转到 Chrome 控制台,我会看到以下错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://hotel.local/app_dev.php/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://hotel.local/app_dev.php/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://hotel.local/app_dev.php/css/images/ui-bg_glass_100_f6f6f6_1x400.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://hotel.local/app_dev.php/css/images/ui-icons_ffffff_256x240.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://hotel.local/app_dev.php/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
我认为问题可能出在css文件中的路径上,但我不确定。
有什么帮助吗?