qa-data/di-service-attribute

Automatic class registration using a simple attribute for Nette

Installs: 606

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/qa-data/di-service-attribute

v1.0 2024-10-01 20:38 UTC

This package is auto-updated.

Last update: 2025-09-29 03:08:04 UTC


README

Automatic class registration using a simple attribute for Nette.

Setup

DiAttibute is available on composer:

composer require qa-data/di-service-attribute

At first register compiler extension.

extensions:
	diAttribute: QaData\DiAttribute\DI\DiAttributeExtension

Configuration

diAttribute:
	# Paths to scan for classes
	paths:
		- %appDir%/model
	# If you need to exclude some namespaces or classes
	excludes:
		- App\Model\IgnoreMe

Usage

<?php declare(strict_types=1);

namespace App\Model\Awesome;

use QaData\DiAttribute\DiRegisterService;

#[DiRegisterService]
class AwesomeService
{
	...
}