PHPackages                             squidit/slim-attribute-router - 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. squidit/slim-attribute-router

ActiveLibrary[Framework](/categories/framework)

squidit/slim-attribute-router
=============================

Slim (v4) Framework - Attribute Router

v0.1.2(5y ago)063↓100%MITPHPPHP ^8.0

Since Jan 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/squid-it/slim-attribute-router)[ Packagist](https://packagist.org/packages/squidit/slim-attribute-router)[ RSS](/packages/squidit-slim-attribute-router/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (6)Used By (0)

Slim (v4) Framework - Attribute Router
======================================

[](#slim-v4-framework---attribute-router)

Attribute Action/Controller router

This package allows you to add routes to your slim4 () application using attributes in your action classes.

### Features

[](#features)

- Route Method support
- Route name support

Attribute signature
-------------------

[](#attribute-signature)

**\#\[Route({route}\[\[, {methods}\], {routeName}\])\]**

Parameterexample valueDescription{route}'/hello/{name}'(string) The route pattern{methods}\['GET', 'POST'\](array) The allowed HTTP request methods{routeName}'helloRoute'(string) The name of the routeAdding Attribute to an ActionController
---------------------------------------

[](#adding-attribute-to-an-actioncontroller)

If you want to add a route using attributes you can accomplish this by adding a `#[Route({route}[[, {methods}], {routeName}])]`route tag to your class method. please see examples:

Example
web address test 1:

```
