PHPackages                             webfactory/object-routing - 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. webfactory/object-routing

ActiveLibrary

webfactory/object-routing
=========================

Library for generating routes based on objects.

2.2.0(3mo ago)019.3k—0%[1 issues](https://github.com/webfactory/object-routing/issues)Apache-2.0PHPPHP &gt;= 8.1CI passing

Since Sep 12Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/webfactory/object-routing)[ Packagist](https://packagist.org/packages/webfactory/object-routing)[ RSS](/packages/webfactory-object-routing/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (21)Used By (0)

Object Routing Library
======================

[](#object-routing-library)

This library allows to create routes based on *objects*. This can help reduce repetitive code patterns when the same parameters are read from an object every time a route is used, and also opens up new possibilities through the support of polymorphism.

This repository is a fork of [jms/object-routing](https://github.com/schmittjoh/object-routing), and the original documentation is at .

The library is not tied to any concrete router implementation. It ships with an adapter for Symfony's router.

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

[](#installation)

Install this library through composer as `webfactory/object-routing`.

For Symfony projects, additionally install [webfactory/object-routing-bundle](https://github.com/webfactory/BGObjectRoutingBundle).

Usage
-----

[](#usage)

The preferred and recommended way to declare *object routes* is through PHP attributes, although PHP, XML and YAML drivers are also available. See the original library's documentation on how to use those.

The 1.x version of this library supports configuration through annotations. Annotation support has been removed in the 2.0 release.

```
