This repository is for education. The main goal is to show how to define services in cool Nette Dependency-Injection Container (nette/di).
The examples are written in NEON (take a look at ne-on.org) and in PHP classes called CompilerExtension
.
Related blogposts:
Nette DI | PHP |
---|---|
3.0 | >=7.1 |
2.4 | >=7.1 |
2.3 | <7.2 |
- Configuration (https://doc.nette.org/en/2.4/configuring)
- Dependency injection (https://doc.nette.org/en/2.4/dependency-injection)
- Define extensions (https://doc.nette.org/en/2.4/di-extensions)
- Built-in extensions (https://doc.nette.org/cs/2.4/di-builtin-extensions)
- DI usage (https://doc.nette.org/en/2.4/di-usage)
services:
facebookAuthorizator:
class: App\Model\Security\FacebookAuthorizators(@redisCache)
redisCache: Predis\PredisClient
$builder->addDefinition('facebookAuthorizator')
->setClass('App\Model\Security\FacebookAuthorizators(@redisCache)');
$builder->addDefinition('redisCache')
->setClass('Predis\PredisClient');
- [?] Create some online tool using now.sh (@zeit).