0

我尝试使用 cssembed 过滤器加载我的样式表(因为 css 中引用了图像)

在 config.yml

assetic:
debug:          %kernel.debug%
use_controller: false
bundles:        [ cramifviewkitBundle ]
#java: /usr/bin/java
filters:
    cssrewrite: ~
    cssembed:
        jar: %kernel.root_dir%/Resources/java/cssembed-0.4.5.jar
    yui_css:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
    yui_js:
        jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

我下载 cssembed-0.4.5.jar 并将其定位在src/my_bundle/Resources/java

在我写的模板中:

{% stylesheets 
    '@myBundle/Resources/public/css/*'
    '@myBundle/Resources/public/JQMenu/css/*'
    filter='cssembed'
%}

第一次导入一切都很好,但是对于第二次导入,当我查看萤火虫时,我有这个:

<link type="text/css" href="/viewkit/web/app_dev.php/css/eb2d30c_part_1_jqueryMenus_1.css" rel="stylesheet">

当我打开它时,它不是css而是html,因为有一个错误:

<h1>Exception thrown when handling an exception    (Symfony\Component\HttpKernel\Exception\FlattenException: Warning: json_encode() [<a   href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in C:\wamp\www\viewkit\vendor\monolog\monolog\src\Monolog\Formatter\NormalizerFormatter.php line 99)</h1>
<div class="block_exception clear_fix">
<h2><span>1/1</span> <abbr title="ErrorException">ErrorException</abbr>: Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in  C:\wamp\www\viewkit\vendor\monolog\monolog\src\Monolog\Formatter\NormalizerFormatter.php line 99</h2>
</div>
<div class="block">
 <ol class="traces list_exception">
 <li> in  C:\wamp\www\viewkit\vendor\monolog\monolog\src\Monolog\Formatter\NormalizerFormatter.php line 99</li> 

知道它可能来自哪里吗?

4

1 回答 1

0

按照您在配置中指定的方式放置cssembed-0.4.5.jarinapp/Resources/java目录。

于 2013-03-11T13:20:45.460 回答