Skip to content

Instantly share code, notes, and snippets.

@Thinkscape
Created February 8, 2012 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thinkscape/1772600 to your computer and use it in GitHub Desktop.
Save Thinkscape/1772600 to your computer and use it in GitHub Desktop.
Conceptual description of zf2 AssetManager event-driven inter-module workflow
1) AssetManager module init(): register "resources.collectPath" event with Mod.Manager
2) Other modules' init(): attach listener to "resources.collectPath"
3) Application runs...
4) $this->locator->assetManager->injectCSS();
5) AssetManager: $events->trigger("resources.collectPath").
6) listeners in modules do: $r = $event->getTarget(); $r[] = __DIR__ .'/css/main.css"
7) AssetManager: receives a whole collection of paths
8) AssetManager: merge, minify, output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment