PHPackages                             icanboogie/bind-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. [Framework](/categories/framework)
4. /
5. icanboogie/bind-routing

ActiveLibrary[Framework](/categories/framework)

icanboogie/bind-routing
=======================

Binds icanboogie/routing to ICanBoogie.

5.0(5y ago)03.9k↓84.6%3BSD-3-ClausePHPPHP &gt;=7.2CI failing

Since Mar 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ICanBoogie/bind-routing)[ Packagist](https://packagist.org/packages/icanboogie/bind-routing)[ Docs](https://icanboogie.org/)[ RSS](/packages/icanboogie-bind-routing/feed)WikiDiscussions 6.0 Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (7)Used By (3)

bind-routing
============

[](#bind-routing)

[![Release](https://camo.githubusercontent.com/9a1cc719e67ba8dcebb55c3dc8c0fef6cf791cbbb1941fa4de3070de609a1a03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963616e626f6f6769652f62696e642d726f756e74696e672e737667)](https://packagist.org/packages/icanboogie/bind-rounting)[![Code Coverage](https://camo.githubusercontent.com/0a1e54ba7d65a6f1b80d612e6c3f3d09cfef9ec3eeead72986bdf20ec6ae61fc/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4943616e426f6f6769652f62696e642d726f756e74696e672f62616467652e7376673f6272616e63683d362e30)](https://coveralls.io/r/ICanBoogie/bind-rounting?branch=6.0)[![Downloads](https://camo.githubusercontent.com/16b7621603d29ee7f88ca2b2850f9226463a7739cbee7819e51215824be2a6ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6963616e626f6f6769652f62696e642d726f756e74696e672e737667)](https://packagist.org/packages/icanboogie/bind-rounting)

The **icanboogie/bind-routing** package binds [ICanBoogie/Routing](https://github.com/ICanBoogie/Routing) to [ICanBoogie](https://icanboogie.org/). It provides infrastructure to configure routes and responders, a trait to get URLs from objects, and commands to list routes and actions.

#### Installation

[](#installation)

```
composer require icanboogie/bind-routing
```

Defining routes using attributes
--------------------------------

[](#defining-routes-using-attributes)

The easiest way to define routes is to use attributes such as [Route](lib/Attribute/Route.php) or [Get](lib/Attribute/Get.php) to tag your controller and actions. Using any of these tags triggers the registration of the controller as a service (if it is not already registered), and the tagging with `action_responder` and `action_alias`.

The following example demonstrates how the [Route](lib/Attribute/Route.php) attribute can be used at the class level to specify a prefix for all the actions of a controller. The [Get](lib/Attribute/Get.php) and \[Post\]\[\] attributes are used to tag actions. If left undefined, the action is inferred from the controller class and the method name.

```
