1. Go to this page and download the library: Download passchn/cakephp-simple-di library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
passchn / cakephp-simple-di example snippets
public function services(ContainerInterface $container): void
{
Configure::load('app_di');
DIManager::create($container)
// to add individual services:
->addServices(Configure::readOrFail('DI.services'))
/**
* to collect multiple services, define a module:
* @see \Passchn\SimpleDI\Module\Module\ModuleInterface
*/
->addModules(Configure::readOrFail('DI.modules'))
/**
* a plugin can define multiple modules:
* @see \Passchn\SimpleDI\Module\Plugin\PluginInterface
*/
->addPlugin(SomePlugin::class);
}