spoonx / sxbootstrap
A twitter bootstrap module for ZF2 (zend framework 2) based on rwoverdijk/assetmanager
Installs: 10 703
Dependents: 1
Suggesters: 0
Security: 0
Stars: 29
Watchers: 7
Forks: 12
Open Issues: 4
Requires
- php: >=5.3.3
- spoonx/sxcore: 1.*
Requires (Dev)
- phpunit/phpunit: *
- spiffy/spiffy-navigation: dev-master
- zendframework/zendframework: dev-master
Suggests
- fortawesome/font-awesome: Required for Font Awesome integration
- rwoverdijk/assetmanager: Required for the renderer
- spiffy/spiffy-navigation: Required for SxNavigationMenu and dropdown
- twbs/bootstrap: Required for the renderer
Replaces
README
This module supplies view helpers to make it easy to work with twitter bootstrap. Optionally, this module also allows you to build, cache, modify and extend twitter bootstrap using the AssetManager module.
Note:
Support for bootstrap 3.0 is under active development. You can help and test by checking out the 3.0.0 branch.
Installation ViewHelpers
How?
Add the requirement to your composer.json file
./composer.phar require spoonx/sxbootstrap
# When asked for a version, type: "2.*"
Installation Font Awesome
How?
-
Add the dependency to your composer.json file:
./composer.phar require fortawesome/font-awesome # When asked for a version, type: "3.*"
-
Enable the use of Font Awesome by adding the following in
config/autoload/sxbootstrap.local.php
:<?php return array( 'twitter_bootstrap' => array( 'use_font_awesome' => true, ), );
Installation renderer (recommended)
How?
-
Add the dependencies to your composer.less file:
./composer.phar require rwoverdijk/assetmanager twbs/bootstrap # When asked for a version, type: "1.*" for assetmanager and "2.*" for bootstrap.
-
Enable
AssetManager
andSxBootstrap
in yourapplication.config.php
config file. -
Install less...
a) Via NPM/Node.js (recommended method):
1. Install npm/node.js. [Instructions](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) can be found here. 2. To Install lessc, open up your command line, and navigate to your project (`cd /path/to/my/project`). 3. Once you get there, run the following command: `npm install less .` (including the dot).
b) Via lessphp (Advised against):
**Add the requirement** ```bash ./composer.phar require leafo/lessphp # When asked for a version, type: "0.*" ``` Then add the following config to your application's module.config.php: ```php 'twitter_bootstrap' => array( 'use_lessphp' => true, ), ```
-
Configure the filter to get it working. (This only applies to you if your using node.js and the binary is not in
/usr/bin/node
, or your node paths are not the default, so you've ignored my advice in step 3a.) -
Take a look at the wiki for examples and other information to get started. Specifically the part on how to configure the filter to get it working (bottom of the page)
Okay... Why?
The renderer has a lot of advantages.
- Allows easy customization
- Allows you to extend (use mixins and variables in your own less files!)
- Prevents having to manually manage assets
- Allows toggling components, and plugins to include (minimizing file size by not included what you do not need).
- And more.
Features
- Simple awesome forms
- NEW Optional Font Awesome integration
- NEW Add load paths
- NEW Add custom components
- Customizable (variables, components, plugins)
- Works with AssetManager
- Plenty of ViewHelpers
- Extendable (run your own less files from bootstrap context to share mixins and variables)
- Tested with twitter bootstrap 2.3+ (older versions will probably work, too)
- You can optionally use lessphp (not recommended)
Usage
Check out the config/sxbootstrap.local.php.dist
file in vendor/spoonx/sxbootstrap/config for the configuration options, and info.
Also, please check out the wiki.
Questions / support
If you're having trouble with the module there are a couple of resources that might be of help.
- The wiki page, where you'll perhaps find your answer.
- RWOverdijk at irc.freenode.net #zftalk.dev
- Issue tracker. (Please try to not submit unrelated issues).
- By mail