问题
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.
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 am dumping files with:
php app/console assetic:dump --env=prod --no-debug
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
Loading the javascript tag via:
{% javascripts '@admin_js' output='js/admin.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
My question is, where is this phantom _part_1 coming from and how can I tell it stop adding it in?
回答1:
Where is it coming from?
Well, in the current()
method in Assetic/Asset/Iterator/AssetCollectionIterator.php on line 67 (current master).
How do I get rid of it?
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.
来源:https://stackoverflow.com/questions/19057196/symfony-assetic-part-1-in-url