Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

1. Installation

neilime edited this page Nov 4, 2016 · 2 revisions

Main Setup

With composer (the faster way)

  1. Add this project in your composer.json:

    "require": {
        "neilime/zf2-twb-bundle": "3.*@stable"
    }
  2. Now tell composer to download TwbBundle by running the command:

    $ php composer.phar update

By cloning project (manual)

  1. Clone this project into your ./vendor/ directory.
  2. (Optional) Clone the Twitter bootstrap project (v3.*) into your ./vendor/ directory.

Post installation

  1. Enabling it in your application.config.php file.

    return array(
        'modules' => array(
            // ...
            'TwbBundle',
        ),
        // ...
    );
  2. Include Twitter Bootstrap assets

With AssetsBundle module (easy way)

  • Install the AssetsBundle module(1.0)

  • Install Twitter Bootstrap (v2.3.2)

  • Edit the application module configuration file module/Application/config/module.config.php, adding the configuration fragment below:

    return array(
        //...
         'assets_bundle' => array(
             'assets' => array(
                 'less' => array('@zfRootPath/vendor/twitter/bootstrap/less/bootstrap.less'),
             ),
         ),
         //...
     );
  • Edit layout file module/Application/view/layout/layout.phtml, to render head scripts :

    //...
    echo $this->headScript();
    //...

Manually