PHPackages                             gyro/mvc-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. [Framework](/categories/framework)
4. /
5. gyro/mvc-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

gyro/mvc-bundle
===============

Various improvements for Symfony applications

v0.10.1(5y ago)1667.3k—6.2%2[4 issues](https://github.com/gyro-project/mvc-bundle/issues)MITPHPCI failing

Since Jul 31Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/gyro-project/mvc-bundle)[ Packagist](https://packagist.org/packages/gyro/mvc-bundle)[ RSS](/packages/gyro-mvc-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (8)Versions (24)Used By (0)

Gyro MVCBundle
==============

[](#gyro-mvcbundle)

A small framework on top of Symfony introducing a bunch of conventions, targeting users that want to upgrade from LTS to LTS.

MVCBUndle decouples and simplifies Symfony controllers by adding various abstractions that avoid having to use Symfony services or classes inside the controllers.

This bundle succeeds the "QafooLabsNoFrameworkBundle" package.

Goals
-----

[](#goals)

This allows to write controllers that only have dependencies on the domain/model and let them act as true "application services" that are easily testable.

Gyros goal is achieving slim controllers that are registered as a service explicitly (via YML or XML). The number of services required in any controller should be very small (2-4). We believe Context to controllers should be explicitly passed to avoid hiding it in services.

Ultimately this should make Controllers testable with lightweight unit- and integration tests. Elaborate seperation of Symfony from your business logic should become unnecessary by building controllers that don't depend on Symfony from the beginning (except maybe Request/Response classes).

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

[](#installation)

From Packagist via Composer:

```
composer require gyro/mvc-bundle
```

Add bundle to your application kernel:

```
$bundles = [
    // ...
    new Gyro\Bundle\MVCBundle\GyroMVCBundle(),
];
```

Returning View data from controllers
------------------------------------

[](#returning-view-data-from-controllers)

### Returning Arrays

[](#returning-arrays)

This bundle replaces the `@Extra\Template()` annotation support from the Sensio FrameworkExtraBundle, without requiring to add the annotation to the controller actions.

You can just return arrays from controllers and the template names will be inferred from Controller+Action-Method names.

If you return from the `App\Controller` default namespace, then the template is fetched from ':Ctrl:action.html.twig`.

```
