PHPackages                             knplabs/knp-minibus-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. knplabs/knp-minibus-bundle

ActiveLibrary[Framework](/categories/framework)

knplabs/knp-minibus-bundle
==========================

Integrate minibus into symfony2

0142PHP

Since Nov 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Djeg/MinibusBundle)[ Packagist](https://packagist.org/packages/knplabs/knp-minibus-bundle)[ RSS](/packages/knplabs-knp-minibus-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MinibusBundle [![Build Status](https://camo.githubusercontent.com/36975a442829b7408569f112b24baf13ee7c31a3fcb20a135d20aa8a81ac6c1c/68747470733a2f2f7472617669732d63692e6f72672f446a65672f4d696e6962757342756e646c652e737667)](https://travis-ci.org/Djeg/MinibusBundle) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/f71f48f4982b3dff9e200c69727f35140eef751a00c652ad0e8a92d42deeffb0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446a65672f4d696e6962757342756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Djeg/MinibusBundle/?branch=master) [!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/Djeg/MinibusBundle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#minibusbundle---gitterhttpsbadgesgitterimjoin-chatsvg)

 [![minibus](.images/minibus_mini.png)](.images/minibus_mini.png)

Yolo Yolo ^.^. This is an integration of [Minibus](https://github.com/Djeg/Minibus)for Symfony2 applications.

A Minibus, but why ?
--------------------

[](#a-minibus-but-why-)

Minibus is a standalone **PHP 5.4** library which allows you to decouple your application responsabilities and actions into plural **stations**. The main goal is to create **meaningful controllers** and **limit their responsabilities**. For example with Minibus, your **application entry points** have nothing to do with the **view**. Their responsability will only be to change and retrieve a given **state**.

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

[](#installation)

Install the bundle:

```
$ php composer.phar require knplabs/knp-minibus-bundle

```

Update your `AppKernel`:

```
// app/AppKernel.php
$bundles = [
    // ...
    new Knp\MinibusBundle\KnpMinibusBundle,
];
```

Quick view
----------

[](#quick-view)

You were waiting for a demonstration, here it is!

### Create a MinibusBundle

[](#create-a-minibusbundle)

In order to start working with Minibus you need to create your first `MinibusBundle`:

```
namespace App;

use Knp\MinibusBundle\Bundle\MinibusBundle;

class AppBundle extends MinibusBundle
{
}
```

Now register it inside your `AppKernel`:

```
// app/AppKernel.php
$bundles = [
    // ...
    new App\AppBundle,
];
```

### Create stations

[](#create-stations)

Stations are like controllers, except that you can launch as many stations as you want during one **action** and the station **does not handle any kind of view**. In fact the only role of a station is to create/retrieve/update `Minibus` passengers. (understand data).

Station **must** be located under `BundleNamespace\Station` and implements `Knp\Minibus\Station`. This is a station example:

```
namespace App\Station;

use Knp\Minibus\Station;
use Knp\Minibus\Minibus;

class UsernameStation implements Station
{
    public function handle(Minibus $minibus, array $configuration = [])
    {
        $minibus->addPassenger('username', 'Sheldon Cooper');
    }
}
```

### Routing

[](#routing)

MinibusBundle comes with a complete yaml routing syntax that allows you to easily create a **line**. Once you get some stations ready to be used you can load a minibus routing:

```
# app/config/routing.yml
app:
    resource: @AppBundle/Resources/config/routing.yml
    type: minibus
    prefix: /
```

Here comes the routing:

```
app_some_action:
    pattern: /some/action
    method: GET
    line:
        app.username: ~
        app.other: ~
        app.magic: ~
    terminus:
        twig:
            template: "App::some.html.twig"
    passengers:
        magic_man:
            service: some_service_id
            method: getMagicMan
```

Give it a try!
--------------

[](#give-it-a-try)

That's pretty it. **Give it a try!**.

Of course if you want a complete documentation of this bundle you just have to follow the guide!

Get more!
---------

[](#get-more)

- [Stations and services](.doc/stations.md)
- [The routing in details](.doc/routing.md)
- [Understand what is a terminus](.doc/terminus.md)
- [Drive safely, validate your stations](.doc/stations_validation.md)
- [Hack the minibus with events](.doc/events.md)
- [Create configurable stations and terminus](.doc/configurable_stations_and_terminus.md)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48c3eff3833f9fae78b1e9eb04f055428287d6a21067164c8a7d1d932679b742?d=identicon)[davidjegat](/maintainers/davidjegat)

---

Top Contributors

[![Djeg](https://avatars.githubusercontent.com/u/1638230?v=4)](https://github.com/Djeg "Djeg (38 commits)")

### Embed Badge

![Health badge](/badges/knplabs-knp-minibus-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/knplabs-knp-minibus-bundle/health.svg)](https://phpackages.com/packages/knplabs-knp-minibus-bundle)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
