Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/contributte/cookbook
:notes: Cookbook for Nette Framework (@nette) & Contributte (@contributte). Read it while its HOT!
https://github.com/contributte/cookbook
configuration contributte dependency-injection documentation manual neon nette nette-framework php services
Last synced: 26 days ago
JSON representation
:notes: Cookbook for Nette Framework (@nette) & Contributte (@contributte). Read it while its HOT!
- Host: GitHub
- URL: https://github.com/contributte/cookbook
- Owner: contributte
- License: mit
- Created: 2015-10-16T16:40:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-16T19:14:57.000Z (over 1 year ago)
- Last Synced: 2024-09-30T13:59:42.077Z (about 1 month ago)
- Topics: configuration, contributte, dependency-injection, documentation, manual, neon, nette, nette-framework, php, services
- Language: PHP
- Homepage: https://contributte.org
- Size: 38.1 KB
- Stars: 32
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nette Cookbook
[![Build Status](https://img.shields.io/travis/contributte/cookbook.svg?style=flat-square)](https://travis-ci.org/contributte/cookbook)
----
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](https://ne-on.org)) and in PHP classes called `CompilerExtension`.Related blogposts:
- https://f3l1x.io/blog/2015/10/17/nette-jak-zapisovat-sluzby/## Versions
| Nette DI | PHP |
|-------|------|
| [3.0](3.0) | >=7.1 |
| [2.4](2.4) | >=7.1 |
| [2.3](2.3) | <7.2 |## Latest reference
* 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)## Example
### NEON
```yaml
services:
facebookAuthorizator:
class: App\Model\Security\FacebookAuthorizators(@redisCache)
redisCache: Predis\PredisClient
```### PHP
```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](https://github.com/zeit)).