All Projects → deprecated-packages → ControllerAutowire

deprecated-packages / ControllerAutowire

Licence: MIT License
[DEPRECATED] Use Controller autowiring by default since Symfony 3.3

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ControllerAutowire

Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-8.33%)
Mutual labels:  controller, dependency-injection
phpstan-symfony
*DEPRECATED* Symfony extension for PHPStan
Stars: ✭ 42 (+75%)
Mutual labels:  controller, dependency-injection
telephone-ts
Telephone-ts: The "Event Emitter-less" TypeScript Event Architecture.
Stars: ✭ 22 (-8.33%)
Mutual labels:  dependency-injection, autowiring
diod
A very opinionated inversion of control (IoC) container and dependency injector for Typescript, Node.js or browser apps.
Stars: ✭ 36 (+50%)
Mutual labels:  dependency-injection
VGamepad
Server-Side Installer & Instructions
Stars: ✭ 19 (-20.83%)
Mutual labels:  controller
dagger-track
Gradle plugin to add clock trackings to your dagger components and subcomponents
Stars: ✭ 59 (+145.83%)
Mutual labels:  dependency-injection
scorpion
Simple IoC for ruby
Stars: ✭ 16 (-33.33%)
Mutual labels:  dependency-injection
Android-Learning-Resources
My curated list of resources for learning Android Development.
Stars: ✭ 24 (+0%)
Mutual labels:  dependency-injection
TVToday
iOS TV Shows app with TMDb Api. RxSwift, MVVM, Clean Architecture. Tuist + Swift Package Manager
Stars: ✭ 27 (+12.5%)
Mutual labels:  dependency-injection
granitic
Web/micro-services and IoC framework for Golang developers
Stars: ✭ 32 (+33.33%)
Mutual labels:  dependency-injection
siringa
Minimalist dependency injection library for Python that embraces type annotations syntax
Stars: ✭ 51 (+112.5%)
Mutual labels:  dependency-injection
ECommerceProjectWithWebAPI
.NET 5.0 Web API İle E-Ticaret Sitesi Yapımı MVC,Win Form,Angular ve Mobil
Stars: ✭ 35 (+45.83%)
Mutual labels:  dependency-injection
lifeline-rs
A dependency injection library for message-based applications
Stars: ✭ 32 (+33.33%)
Mutual labels:  dependency-injection
catchflicks
🎬 Kitchen sink project for learning android concepts 🎬
Stars: ✭ 12 (-50%)
Mutual labels:  dependency-injection
ToDoApp
📱My android playground app - Simple and Fastest todo app - developing to cover most android concepts, simple logic can make me focus more on framework
Stars: ✭ 28 (+16.67%)
Mutual labels:  dependency-injection
sqlite-dotnet-core
.NET Core 2.1 Console Application using SQLite with Entity Framework and Dependency Injection
Stars: ✭ 17 (-29.17%)
Mutual labels:  dependency-injection
simple-container
Yet another DI container
Stars: ✭ 12 (-50%)
Mutual labels:  dependency-injection
nestjs-stripe
Provides an injectable Stripe client to nestjs modules
Stars: ✭ 126 (+425%)
Mutual labels:  dependency-injection
di.libx.js
💉 di.libx.js - Lightweight & non intrusive Dependency Injection module that supports async/deferred resolution and uglified support
Stars: ✭ 32 (+33.33%)
Mutual labels:  dependency-injection
Football-App
⚽ Football App using MVVM, LiveData, RxJava2, DI, Room, Repository Patern
Stars: ✭ 17 (-29.17%)
Mutual labels:  dependency-injection

Controller Autowire - Deprecated, in core of Symfony 3.3+


Build Status Code Coverage Downloads

This bundle does only 2 things. But does them well:

  • 1. registers controllers as services and
  • 2. enables constructor autowiring for them

Still wondering why use controller as services? Check this and this article.

Install

composer require symplify/controller-autowire

Add bundle to AppKernel.php:

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new Symplify\ControllerAutowire\SymplifyControllerAutowireBundle(),
            // ...
        ];
    }
}

Usage

class SomeController
{
    private $someClass;

    public function __construct(SomeClass $someClass)
    {
        $this->someClass = $someClass;
    }
}

Used to FrameworkBundle's controller? Use helpers traits!

Inspired by pull requests to Symfony and setter injection that are currently on-hold, here are the traits you can use right now:

use Symplify\ControllerAutowire\Controller\Routing\ControllerAwareTrait;

final class SomeController
{
    use ControllerAwareTrait;

    public function someAction()
    {
        $productRepository = $this->getDoctrine()->getRepository(Product::class);
        // ...

        return $this->redirectToRoute('my_route');
    }
}

Do you prefer only traits you use?

use Symplify\ControllerAutowire\Controller\Routing\ControllerRoutingTrait;

final class SomeController
{
    use ControllerRoutingTrait;

    public function someAction()
    {
        return $this->redirectToRoute('my_route');
    }
}

Just type Controller*Trait in your IDE to autocomplete any of these traits.

That's all :)

Contributing

Send issue or pull-request to main repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].