问题描述
好吧所以我一直在寻找一些输入,但没有找到任何可以直接帮助的东西(只提到与其他事情有关的这个问题)。
Okay so I've been searching all over for some input into this but haven't found anything to help directly (only mentions of this problem in relation to something else).
基本上我在查找资产文件时生成的路径资产与实际生成的资产相比有问题。
Basically I'm having problems with the path assetic generates when looking for an assetic file versus what is actually generated.
它尝试加载的路径是: /js/admin_part_1.js ,而它生成的文件只是 /js/admin.js
The path it's trying to load is: /js/admin_part_1.js whereas the file it is generating is simply /js/admin.js
I我正在转储文件:
php app / console assetic:dump --env = prod --no-debug
config.yml的相关部分:
Relevant portion of the config.yml:
assetic:
debug: "%kernel.debug%"
use_controller: false
filters:
cssrewrite: ~
assets:
admin_js:
inputs:
- @UserBundle/Resources/js/admin-tools.js
output: js/admin.js
加载ja vascript标签来自:
Loading the javascript tag via:
{% javascripts '@admin_js' output='js/admin.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
我的问题是,这个幻影_part_1来自哪里?我怎么能告诉它停止添加呢?
My question is, where is this phantom _part_1 coming from and how can I tell it stop adding it in?
推荐答案
它来自哪里?
嗯,在。
Where is it coming from?
Well, in the current()
method in Assetic/Asset/Iterator/AssetCollectionIterator.php on line 67 (current master).
在开发环境中添加'part_#'字符串。转储资产时,请确保将 - env = prod
添加到 assetic:dump
命令。请务必使用 app_dev.php
访问该页面。
The 'part_#' string is added in the development environment. When you dump the assets, make sure you add --env=prod
to the assetic:dump
command. Make sure you use app_dev.php
to access the page.
这篇关于Symfony Assetic - url中的part_1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!