PHPackages                             saeven/zf3-circlical-autowire - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. saeven/zf3-circlical-autowire

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

saeven/zf3-circlical-autowire
=============================

Annotation based routing, and magic Controller creation for Laminas and ZF3.

2.1(4y ago)1430.0k↓50%2MPL-2.0PHPPHP ^7.4 | &gt;=8

Since Oct 13Pushed 2y ago5 watchersCompare

[ Source](https://github.com/Saeven/zf3-circlical-autowire)[ Packagist](https://packagist.org/packages/saeven/zf3-circlical-autowire)[ Docs](https://github.com/Saeven/zf3-circlical-autowire)[ RSS](/packages/saeven-zf3-circlical-autowire/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (12)Versions (10)Used By (0)

Route Auto-Wiring for Laminas-MVC
=================================

[](#route-auto-wiring-for-laminas-mvc)

[![Build Status](https://github.com/saeven/zf3-circlical-autowire/actions/workflows/phpspec-task.yml/badge.svg)](https://github.com/Saeven/zf3-circlical-autowire/actions)[![Codacy Badge](https://camo.githubusercontent.com/4d4d5e943437e253c072da0259e6818b03bd399adb7087985e5ce017355609f5/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3734613832333366663134363466616461316133333331303437373037303566)](https://www.codacy.com/gh/Saeven/zf3-circlical-autowire/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Saeven/zf3-circlical-autowire&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/74c86fb3da4c3f9411ad41590aee1bf954a45fbef73507434cd9871d1d9c478b/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3734613832333366663134363466616461316133333331303437373037303566)](https://www.codacy.com/gh/Saeven/zf3-circlical-autowire/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Saeven/zf3-circlical-autowire&utm_campaign=Badge_Coverage)[![Total Downloads](https://camo.githubusercontent.com/150aa19bfe6bb409c43a26316191bd4ee2b6928140ef61d998b533eda599cb53/68747470733a2f2f706f7365722e707567782e6f72672f73616576656e2f7a66332d636972636c6963616c2d6175746f776972652f646f776e6c6f616473)](https://packagist.org/packages/saeven/zf3-circlical-autowire)

A laminas-mvc module that favors rapid development, it does two things:

- compiles routes to standard PHP arrays for production (and merges them automatically for you too). Does not compete with standard route declarations (both can be used in tandem).
- automatically applies DI into your controllers, do you don't need to write a ton of simple factories

> Older versions support zend-mvc, check releases.

Use annotations right above your actions to automatically plug routes into the ZF3 Router. No more gear-switching to route files, or digging through route config arrays when you are refactoring.

This module also provides a reflection-based abstract factory to automatically wire your controllers using their constructors. Just define your constructors (as you should) and let the lazy factory do the rest!

\##Installation

Install with:

```
composer require zf3-circlical-autowire

```

Then, add it near the top of your application.config.php

```
'CirclicalAutoWire',

```

Automatic Controller DI
=======================

[](#automatic-controller-di)

Don't need to do anything. Excellently lazy, it's automatic. You can code Controllers, add dependencies to your constructor, and this module will inject classes from your service container right into your controller.

Automatic Routes
================

[](#automatic-routes)

In any controller that should use this module, simply add this **use statement**:

```
use CirclicalAutoWire\Annotations\Route;

```

### Method Annotations

[](#method-annotations)

On any action in a controller with the use statement, use these types of annotations:

```
