No description provided.
Ability to change asset factory root
what is the use case for making it mutable ?
I want to be able to specify different root paths for each collection in the same module when using AsseticBundle. Of course I could create a new AssetFactory for every collection, but I think that's a waste of resources.
and what is the use case for specifying a different root for each collection ?
Let's say I have a package installed using composer in project//vendor/mymodule and it has some JS files.
I want to use jQuery and install it using composer (components/jquery) in project//vendor/components.
This way jQuery is outside the module and I'd have to specify a full path or a few of ../../ for assetic to take it. This configuration is unacceptable because it doesn't allow me to use one config for both of the following situations:
In my case both of these should work without additional changes.
Can you use the root option?
$asset = $factory->createAsset(..., [ 'root' => '...' ]);
In that case I'd have to use absolute path and I need it relative.