Skip to content
Permalink
Browse files

DI: dynamic => external

  • Loading branch information...
dg committed Oct 24, 2018
1 parent 8a22203 commit a2dd676139e8cd7d3cb9845b66837a255e2697b0
Showing with 8 additions and 8 deletions.
  1. +4 −4 cs/bootstrap.texy
  2. +4 −4 en/bootstrap.texy
@@ -147,16 +147,16 @@ $configurator->addDynamicParameters([
\--


Dynamické služby
================
Externí služby
==============

Do DI kontejneru můžeme vložit vlastní instanci třídy, namísto toho, aby ji vytvářel sám. Službu musíme definovat s příznakem `dynamic: true`.
Do DI kontejneru můžeme vložit vlastní instanci třídy, namísto toho, aby ji vytvářel sám. Službu musíme definovat s příznakem `external: true`.

/--neon
services:
myservice:
type: App\Model\MyCustomService
dynamic: true
external: true
\--

A v bootstrapu do kontejneru vložíme objekt:
@@ -145,16 +145,16 @@ $configurator->addDynamicParameters([
\--


Dynamic Services
================
External Services
=================

We can insert an instance of a class into the DI container directly, before the DI container creates it for us. The service must be defined with the `dynamic: true` attribute.
We can insert an instance of a class into the DI container directly, before the DI container creates it for us. The service must be defined with the `external: true` attribute.

/--neon
services:
myservice:
type: App\Model\MyCustomService
dynamic: true
external: true
\--

Create a new instance and insert it in bootstrap:

0 comments on commit a2dd676

Please sign in to comment.
You can’t perform that action at this time.