1. Go to this page and download the library: Download lapaz/aura-di-ext 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/ */
lapaz / aura-di-ext example snippets
$di->set('routerContainer', $di->lazy(function () use ($di) {
$routerContainer = $di->newInstance(\Aura\Router\RouterContainer::class, [], [
'setLoggerFactory' => function () use ($di) {
return $di->get('logger');
},
// Don't use ->lazyGet() because the returned lazy object would be evaluated before injection.
]);
$map = $routerContainer->getMap();
$map->get('index', '/');
// ...
return $routerContainer;
));