kriswallsmith/assetic — Issue #182: AssetWriter not working
Author: abxccd
Created: 2012-02-13 10:02:30+00:00
State: open

I am using Assetic with Twig but not symfony2. I am writing a simple script to load all my twig templates and then dump my assets.

Here's a sample template whose assets I would like dumped.

```

{% block head %}

{% stylesheets 'print.css' output='css/test.css' %}

{% endstylesheets %}

```

And here's the code I am using to dump:
```
//Twig
$loader = new \Twig_Loader_Filesystem(array());
$twig = new \Twig_Environment($loader);

//Assetic
$factory = new AssetFactory(SOURCE);
$factory->setDebug(false);
$am = new LazyAssetManager($factory);

//enable loading assets from twig templates
$am->setLoader('twig', new TwigFormulaLoader($twig));

$templates = array"'D:\\dev\\test\\test.html.twig", etc) //An array containing full paths to my templates

foreach ($templates as $template) {
$resource = new TwigResource($loader, $template);
$am->addResource($resource, 'twig');
$writer = new AssetWriter("D:\\dev\\web\\");
$writer->writeManagerAssets($am);
}
```
To simplify things, I have placed my css in the same folder as my twig files. Why is it that "D:\dev\web\css\test.css" never written?