Contributte Cookbook

Build Status (opens new window)


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 (opens new window)) and in PHP classes called CompilerExtension.

Related blogposts:

# Versions

Nette DI PHP
3.0 >=7.1
2.4 >=7.1
2.3 <7.2

# Latest reference

# Example

# NEON

services:
  facebookAuthorizator: 
    class: App\Model\Security\FacebookAuthorizators(@redisCache)
    
  redisCache: Predis\PredisClient
1
2
3
4
5

# PHP

$builder->addDefinition('facebookAuthorizator')
    ->setClass('App\Model\Security\FacebookAuthorizators(@redisCache)');

$builder->addDefinition('redisCache')
    ->setClass('Predis\PredisClient');
1
2
3
4
5

# Roadmap