2

下面是完整的输出:

> php.exe C:\xampp\htdocs\bootstrap\app\console assetic:dump
Dumping all dev assets.
Debug mode is on.

[file+] C:\xampp\htdocs\bootstrap\app/../web/css/992f634.css
'stty' is not recognized as an internal or external command,
operable program or batch file.



  [RuntimeException]                                                  
  The filename, directory name, or volume label syntax is incorrect.  




assetic:dump [--watch] [--force] [--period="..."] [write_to]



Process finished with exit code 1 at 23:12:02.
Execution time: 1,118 ms.

我正在安装 MopaBootstrapBundle。我可以在没有样式的情况下访问该站点。可能出了什么问题?下面是我的 config.yml

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    # java: /usr/bin/java
    filters:
        cssrewrite: ~
        less:
            node: C:\nodejs
            node_paths: [C:\nodejs\node_modules]
        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
        # closure:
        #     jar: %kernel.root_dir%/java/compiler.jar

请帮帮我,我不知道还能做什么。=(

4

1 回答 1

2

我无法使用我的 Symfony2 安装来减少工作,所以我使用了 lessphp。这里是如何使用 MopaBootstrapBundle 配置lessphp并有效地消除我的问题。顺便说一句,这个解决方案也类似于如何使用 Windows 机器运行MopaBootstrapBundle 。

//add this to your deps file, then install
[lessphp]
    git = "https://github.com/leafo/lessphp.git"
    target = "/lessphp"

//add this to your autoload.php
$loader->registerPrefixes(array(
    //some codes here
    'lessc'            => __DIR__.'/../vendor/lessphp',
));

//add this to config.yml
assetic:
    filters:
        less: ~
        lessphp:
            apply_to: "\.less$"
            file:   %kernel.root_dir%/../vendor/lessphp/lessc.inc.php

//override the layout.html.twig, either only to your bundle or from the app/Resources
{% extends 'MopaBootstrapBundle::layout.html.twig' %}
{% block head_style %}
    {% stylesheets
        '@MopaBootstrapBundle/Resources/public/less/mopabootstrapbundle.less'
    %}
    <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
    {% endstylesheets %}
{% endblock head_style %}

希望这可以帮助。=)

于 2012-05-05T08:11:22.133 回答