PHPackages                             m4nu/object-route-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. m4nu/object-route-bundle

ActiveSymfony-bundle

m4nu/object-route-bundle
========================

Symfony M4nuObjectRouteBundle

47PHP

Since Oct 28Pushed 12y ago1 watchersCompare

[ Source](https://github.com/M4nu/ObjectRouteBundle)[ Packagist](https://packagist.org/packages/m4nu/object-route-bundle)[ RSS](/packages/m4nu-object-route-bundle/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (2)Used By (0)

M4nuObjectRouteBundle
=====================

[](#m4nuobjectroutebundle)

This Symfony2 bundle allows to create routes from an object instead of parameters.

[![Build Status](https://camo.githubusercontent.com/5136342d96a4535cc193ebd973961aff6ac6d4953fd80a9e4ff84fb04a64a687/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4d346e752f4d346e754f626a656374526f75746542756e646c652e706e67)](http://travis-ci.org/M4nu/M4nuObjectRouteBundle)

\#How to install ?

\##Add theses lines into your deps

```
[M4nuObjectRouteBundle]
    git=git://github.com/M4nu/M4nuObjectRouteBundle.git
    target=/bundles/M4nu/ObjectRouteBundle

```

\##Add autoloading

```
#app/autoload.php
$loader->registerNamespaces(array(
    #...
    'M4nu' => __DIR__.'/../vendor/bundles',
));
```

\##Register this bundle

```
#app/AppKernel.php
$bundles = array(
    #...
    new M4nu\ObjectRouteBundle\M4nuObjectRouteBundle(),
);
```

\##Install the deps

```
php bin/vendors install
```

\#Examples

Let's say we have a Category and a Message object :

```
$category = new Category();
$category->setSlug('my-category');

$message = new Message();
$message->setSlug('my-message');
$message->setCategory($category);
```

And the corresponding route :

```
message_show:
    pattern:   /message/{category.slug}/{slug}
```

Create the corresponding route
------------------------------

[](#create-the-corresponding-route)

```
$router->generate('message_show', $message);
```

```
{{ path('message_show', message) }}
```

Will output: `/message/my-category/my-message`

Override parameters
-------------------

[](#override-parameters)

```
$router->generate('message_show', array('_object' => $message, 'slug' => 'my-custom-slug'));
```

```
{{ path('message_show', {'_object': message, 'slug': 'my-custom-slug'}) }}
```

Will output: `/message/my-category/my-custom-slug`

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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/27b8e20d348e38edf144873d093b29efb56507edb2d36fa67e04ce6c9ceb896c?d=identicon)[EmmanuelVella](/maintainers/EmmanuelVella)

---

Top Contributors

[![EmmanuelVella](https://avatars.githubusercontent.com/u/663607?v=4)](https://github.com/EmmanuelVella "EmmanuelVella (9 commits)")

### Embed Badge

![Health badge](/badges/m4nu-object-route-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/m4nu-object-route-bundle/health.svg)](https://phpackages.com/packages/m4nu-object-route-bundle)
```

PHPackages © 2026

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