Skip to content
Artur Bodera edited this page Sep 16, 2013 · 10 revisions

Because of the amount of questions I've been getting over IRC and github issues, I've decided to set up a FAQ. Most of these entries are not big enough having their own wiki page. If they were, I've probably already updated those pages to reflect this.

Q: Why do filters not work out of the box?

A: I've actually dedicated a complete section to this in the wiki. You can find it here under "Missing filters".


Q: What are these aliases I keep reading about?

A: Aliases are the keys you use in your configuration. Let's say you have a map entry in your resolver configuration, then the key will be the alias. 'js/my-alias.js' => 'js/actual-file.js'. These aliases can be used to apply filters and caching to the assets.

Note: If no alias was supplied (like with paths / prioritized paths) then the actual requested path will be the alias.


Q: How do I add parameters to filters?

A: You can modify a filter in whatever way you like by just specifying a "service" in stead of a "filter". This way you get to return a filter, which has been instantiated by you. Take a look at the filters entry in the wiki at the bottom of the page (services).


__Q: Isn't using the AssetManager bad for performance?__

A: Out of the box, yes. You'll have to apply caching to make sure that the resolved assets will be served a lot faster on the second request. Using the FilePath cache is recommended. Also, please note that the AssetManager is not run on every request. It's only triggered on a 404 and will not try to resolve to an asset on every request. This approach has been chosen to make sure that this module is also safe to use in production environments.


__Q: Am I not going to have a bunch of conflicts with the assets of other modules?__

A: You shouldn't, no. As long as you "namespace" your paths you're good. Example, if your module's name is sxbootstrap, you could prefix all of your paths with sxbootstrap. Example: assets/sxbootstrap/bootstrap.min.js.


__Q: Why are filters applied twice?__

A: Probably because you're applying them to a mime-type, and you're using collections. The filters will be applied to the assets, as well as to the collection itself..

Clone this wiki locally