Php assetic为css提供404

Php assetic为css提供404,php,symfony,assetic,Php,Symfony,Assetic,我在普通php中使用assetic。我在css文件上得到404我犯了什么错误 控制器 看法 什么是{STATIC_PATH}}?根据,您没有理由使用类似{{STATIC_PATH}}的东西。 require_once 'vendor/autoload.php'; $loader = new Twig_Loader_Filesystem('backend/templates'); $twig = new Twig_Environment($loader, array(

我在普通php中使用assetic。我在css文件上得到404我犯了什么错误

控制器

看法

什么是{STATIC_PATH}}?根据,您没有理由使用类似{{STATIC_PATH}}的东西。
    require_once 'vendor/autoload.php';
    $loader = new Twig_Loader_Filesystem('backend/templates');
    $twig = new Twig_Environment($loader, array(
        //'cache' => 'backend/static/gen/templates',
    ));

    use Assetic\Factory\AssetFactory;
    use Assetic\Extension\Twig\AsseticExtension;
    use Assetic\FilterManager;
    use Assetic\Filter\LessFilter;

    $fm = new FilterManager();
    $fm->set('less', new LessFilter());

    $factory = new AssetFactory(dirname(__FILE__).'/backend/static/');
    $factory->setFilterManager($fm);
    $factory->setDebug(true);

    $twig->addExtension(new AsseticExtension($factory));


    echo $twig->render($current_template,$data);
{% stylesheets '{{ STATIC_PATH }}less/bootstrap.less' filter='less' output='gen/all.css' %}
    <link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}