twig_js 与 Symfony 2.3 捆绑

twig_js bundle with Symfony 2.3

我安装 twig_js 包 : https://github.com/schmittjoh/JMSTwigJsBundle/blob/master/Resources/doc/index.rst

我使用 packagist: https://packagist.org/packages/jms/twig-js-bundle

我的布局中有这段代码:

{% javascripts 
    '@AcmeFooBundle/Resources/public/js/ajax.js' 
filter='twig_js, ?yui_js' %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

但是当我尝试使用此命令行转储我的资产时: php app/console assetic:dump

我有这个错误:

[InvalidArgumentException] 模板名称 "Resources/public/js/ajax.js" 无效(格式为 "bundle :section:template.format.engine")。

这里是app/config.yml文件的资产配置:

# Assetic Configuration
assetic:
debug:          "%kernel.debug%"
use_controller: false
bundles:
    - AcmeFooBundle
    - JMSTwigJsBundle
filters:
    yui_js:
        jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
    twig_js:
        resource: "%kernel.root_dir%/../vendor/jms/twig-js-bundle/JMS/TwigJsBundle/Resources/config/services.xml"
        apply_to: "\.twig$"
    cssrewrite: ~
    #java: /usr/bin/java
    #closure:
    #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
    #yui_css:
    #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

有人对此有想法吗?提前谢谢你。

检查这个link...似乎是一个可能的修复方法。

http://symfony.com/doc/current/cookbook/assetic/asset_management.html