Download the PHP package adlogix/zf-symfony-container without Composer
On this page you can find all versions of the php package adlogix/zf-symfony-container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adlogix/zf-symfony-container
More information about adlogix/zf-symfony-container
Files in adlogix/zf-symfony-container
Package zf-symfony-container
Short Description Zend Framework module to leverage the symfony dependency injection container
License MIT
Homepage https://github.com/adlogix/zf-symfony-container
Informations about the package zf-symfony-container
Zend Framework - Symfony DI Container
Zend Framework module to leverage the symfony dependency injection container
Installation
-
Install the module via composer by running:
- Add the
Adlogix\ZfSymfonyContainermodule to the module section of yourconfig/application.config.php
Configuration
Symfony Container parameters can be defined in the application configurations:
Usage
Refer to the documentation of the Symfony DI Component for information on how to use the DI container.
Obtain a symfony defined service
Any existing symfony service will directly be available through the Service Manager of Zend:
Build a symfony defined service with a Zend service dependency
It will happen that you have to use a dependency which is already loaded into the Zend Service Manager. For example, if you are using the Doctrine Module and you need to have the instance of the Entity Manager, you can leverage the ZendServiceProxyFactory class:
With this configuration, and service defined with the symfony container requiring an instance of Doctrine\ORM\EntityManagerInterface will receive this from the Zend Service Manager.
Obtain the symfony container instance
Use the Zend config as Symfony parameters
The module takes care of transforming all zend configurations into Symfony parameters allowing you to immediately use the parameters in the service definition file:
When the Zend configuration contains deep level keys, the "keys" will be concatenated with a dot.
Note: zend configurations using callables will be ignored and cannot be used!
All versions of zf-symfony-container with dependencies
zendframework/zend-modulemanager Version ^2.8
zendframework/zend-servicemanager Version ^2.7
symfony/dependency-injection Version ^3.4
symfony/config Version ^3.4