Skip to content

Commit

Permalink
Added few more documentation tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Mogliev committed Oct 1, 2014
1 parent 408b79d commit 0d63f0d
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,42 @@ and switch them via template map but that feels a bit awkward. This module solve
First of all you need to find and get all Bower packages that your application requires using either
[Bower](http:/bower.io) itself or its substitute [Bowerphp](http://bowerphp.org/) or any other way you prefer.
Then you need to set `bower.bower_folder.os` setting in your configuration - it should point to `bower_components` folder
where you have just installed all packages. By default it is suppoused to be located inside ZF2 application root.
where you have just installed all packages. By default it is supposed to be located inside ZF2 application root.

## Declare packs of Bower packages

Next you need to declare packs of Bower packages you want to use. Each pack is a collection of Bower packages
which you want ot have in both combined (for deploying) and separated (for debugging) states. To do that you need to set:
which you want to have in both combined (for deploying) and separated (for debugging) states. To do that you need to set:

* `bower.pack_folder.os` - filesystem folder where all pack files should be located
* `bower.pack_folder.web` - web path to access all pack files
* `bower.debug_folder.os` - filesystem folder where all debug package files should be located
* `bower.debug_folder.web` - web path to access all debug package files
* `bower.packs.<pack name>.modules` - Bower packages names to form a pack

* `bower.packs.<pack name>.token` - string that will be appended to file path of the pack (to force browser to reload)
* `bower.debug_mode` - flag that determines if you are currently debugging your app and want each pack content in separate files

Most configuration options have default values (check `config/module.config.php` for details), so the only thing
you have to declare in your ZF2 app config is something like this (sample is in YAML just to make it easier to read):

bower:
debug_mode: false
packs:
main:
token: 'f22f0d9703c2ef8dc9cc14f6286ee302'
modules:
- jquery-form
- jquery.mousewheel
- jquery.jscrollpane
- angular
- angular-animate
- angular-messages
- angular-ui-router
admin:
modules:
- jquery
- angular
- bootstrap

Beware of hidden dependencies between packages: module does its best to detect package dependencies
from `bower.json` files but some of them are not declared there (like between `jquery.mousewheel` and `jquery.scrollpane`).
Expand Down

0 comments on commit 0d63f0d

Please sign in to comment.