kriswallsmith/assetic — pull request #142 by schmittjoh (2011-10-19 15:05:38+00:00)
Title: adds support for compile-time variables

This adds support for compile-time variables to assets. For example, if you want to compile an asset for a specific locale/browser, then you could write something like this:

```html+jinja
{% javascripts "foo.js" vars=["locale","browser"] %}

{% endjavascripts %}
```

```yml
# define all possible values for each variable
assetic:
variables:
locale: ["en", "de"]
browser: ["ie", "other"]
```

```php
container = $container;
}

public function getValues()
{
$request = $this->container->get('request');
$client = /** some nice method to get the client from the request */;

return array(
'locale' => $request->getLocale(),
'browser' => $client,
);
}
}
```

I've only worked on Twig support (not sure how much of this is possible with PHP). I'll also open a PR on the AsseticBundle to add support for this.