PHPackages                             exedron/routeller - 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. exedron/routeller

ActiveLibrary[Framework](/categories/framework)

exedron/routeller
=================

Annotation based routing controller for Exedra

01.5kPHP

Since Jun 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/exedron/routeller)[ Packagist](https://packagist.org/packages/exedron/routeller)[ RSS](/packages/exedron-routeller/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

```
- Deprecated : This package has already been merged with https://github.com/rosengate/exedra
```

\\Exedron\\Routeller
====================

[](#exedronrouteller)

A Minimal annotation and reflection based anemic routeful controller for Exedra.

In a simple word, a routeable-action-controller component in steroid.

Introduction
------------

[](#introduction)

Writing a lot of `\Closure` for your deep nested routing can get messier and not so IDE-friendly as they grow much bigger. This package is built to tackle the issue and give you a nice routing controller over your routing groups.

The controller is anemic, flattened and incapable of construction, but knows very well about the routing design.

The annotation design is fairly simple, just a `@property-value` mapping. Nothing much!

Requirement
-----------

[](#requirement)

This package works only for Exedra. It cannot be used independantly, because.. Of course, it's part of Exedra routing component.

Installation and usage
----------------------

[](#installation-and-usage)

### Installation

[](#installation)

Install through composer

```
composer require exedron\routeller dev-master

```

#### Add via service provider

[](#add-via-service-provider)

Setup the service provider

```
// your application instance
$app->provider->add(\Exedron\Routeller\Provider::class);
```

#### Add via routing factory

[](#add-via-routing-factory)

Alternatively, you may manually add the handler, and set up additional things.

```
$app->routingFactory->addGroupHandler(new \Exedron\Routeller\Handler($app));

$app->map->addExecuteHandler('routeller_execute', ExecuteHandler::class);
```

#### Enable caching

[](#enable-caching)

Enable a file based cache

```
$options = array(
    'auto_reload' => true
);

$cache = new \Exedron\Routeller\Cache\FileCache(__DIR__ .'/routing_caches')

$app->provider->add(new \Exedron\Routeller\Provider($cache, $options));
```

The `auto_reload` option lets it reload the cache each time there's some change to the controllers.

### Usage

[](#usage)

On your preferred route, add use the controller using the *group()* method.

```
$app->map['web']->group(\App\Controller\WebController::class);
```

The controller **MUST** by type of *\\Exedron\\Routeller\\Controller\\Controller*.

```
