PHPackages                             beatgeb/terrific-composer-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. beatgeb/terrific-composer-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

beatgeb/terrific-composer-bundle
================================

Makes it easy to develop frontends based on the terrific concept

v0.1(9y ago)124MITPHP

Since Aug 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/beatgeb/TerrificComposerBundle)[ Packagist](https://packagist.org/packages/beatgeb/terrific-composer-bundle)[ RSS](/packages/beatgeb-terrific-composer-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

TerrificComposerBundle
======================

[](#terrificcomposerbundle)

[![Build Status](https://camo.githubusercontent.com/1171d914d5c35056a46c554de07aeb749e21bdc29835a2c074771611b2699119/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6272756e73636867692f5465727269666963436f6d706f73657242756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/brunschgi/TerrificComposerBundle)

The **TerrificComposer** bundle makes it easy to develop frontends based on the [Terrific Concept](http://terrifically.org). It provides you several helpers and tools to streamline your frontend development.

The TerrificComposer bundle depends on the [TerrificCoreBundle](https://github.com/brunschgi/TerrificCoreBundle). For installation of the TerrificCoreBundle, please follow the instructions [there](https://github.com/brunschgi/TerrificCoreBundle).

Installation
------------

[](#installation)

TerrificComposerBundle can be conveniently installed via Composer. Just add the following to your composer.json file:

```
// composer.json
{
    // ...
    require: {
        // ...
        "brunschgi/terrific-composer-bundle": "dev-master"
    }
}

```

Note: Please replace dev-master in the snippet above with the latest stable branch, for example 1.0.\*. Please check the tags on Github for which versions are available. Then, you can install the new dependencies by running Composer’s update command from the directory where your composer.json file is located:

```
php composer.phar update

```

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:

```
// in AppKernel::registerBundles()
public function registerBundles()
{
    return array(
        // ...
        new Terrific\ComposerBundle\TerrificComposerBundle(),
    );
}

```

TerrificComposer creates a bundle for each of your Terrific module. To have them registered automatically, extend `app/AppKernel.php`:

```
// register all terrific modules
$dir = __DIR__.'/../src/Terrific/Module/';

$finder = new Finder();
$finder->directories()->in($dir)->depth('== 0');

foreach ($finder as $file) {
    $filename = $file->getFilename();
    $module = 'Terrific\Module\\'.$filename.'\TerrificModule'.$filename;
    $bundles[] = new $module();
}

```

Import the routing definition in `routing.yml`:

```
# app/config/routing.yml
TerrificComposerBundle:
    resource: "@TerrificComposerBundle/Controller/"
    type:     annotation
    prefix:   /terrific/composer

```

Enable the bundle's configuration in `app/config/config.yml` and `app/config/config_dev.yml`:

```
# app/config/config.yml
terrific_composer:
   composition_bundles: [@TerrificComposition] # optional|default=@TerrificComposition – the bundles where the controllers for your frontend lie
   module_layout: @TerrificComposition::base.html.twig # optional|default=@TerrificComposition::base.html.twig – the layout to take for the separate module view
   module_template: /path/to/your/module/template # optional|default=/path/to/TerrificComposerBundle/Template/Module -> extend or add additional module resources (ie. README.md)

# app/config/config_dev.yml
terrific_composer:
    toolbar: true # enables the composer toolbar in the dev environment

```

Usage
-----

[](#usage)

To see the TerrificComposerBundle in action, download the [Terrific Composer Distribution](http://terrifically.org/composer)and play around with the included examples. For more information about the Terrific Concept, please have a look at

After that, the below should be pretty straight forward ;-)

### Terrific Composer Toolbar

[](#terrific-composer-toolbar)

The Toolbar provides you some useful helpers that helps you to streamline your frontend development.

#### Module / Skin Creation

[](#module--skin-creation)

[![](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/create.png)](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/create.png)

Create module bundles (with or without skin) under /src/Terrific/Module/.

Notice: If you don't use the [Terrific Composer Distribution](http://terrifically.org/composer), you have to register the created modules manually in `app/AppKernel.php`

The generated module structure contains the skeleton of the LESS/JavaScript files in [Terrific](http://terrifically.org)manner, so that you can start right away.

#### Open Resources

[](#open-resources)

[![](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/open.png)](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/open.png)

The open dialog provides you quick access to your modules and pages. By clicking on a module you are able to implement and test it isolated from the rest of your page. Furthermore you can play with different widths, templates and skins.

#### Inspect Mode

[](#inspect-mode)

[![](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/inspect.png)](https://github.com/brunschgi/TerrificComposerBundle/raw/master/Resources/doc/inspect.png)

The inspect mode shows you the used modules on the current page.

### The Composer() annotation

[](#the-composer-annotation)

The bundle provides an `Composer()` annotation for your controllers:

```
