Skip to content

🎶 Cookbook for Nette Framework (@nette) & Contributte (@contributte). Read it while its HOT!

License

MIT, BSD-3-Clause licenses found

Licenses found

MIT
LICENSE
BSD-3-Clause
LICENCE.md
Notifications You must be signed in to change notification settings

contributte/cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Nette Cookbook

Build Status


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:

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

PHP

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

$builder->addDefinition('redisCache')
    ->setClass('Predis\PredisClient');

Roadmap

  • [?] Create some online tool using now.sh (@zeit).