1. Go to this page and download the library: Download guide42/suda 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/ */
guide42 / suda example snippets
$di = new suda\Registry([
MovieFinder::class => function(callable $make) {
return new MovieFinder;
},
MovieLister::class => function(callable $make, MovieFinder $finder) {
return new MovieLister($finder);
},
]);
$di = new Registry; // creates empty registry
$di = new Registry(array $values); // ... with assoc-array containing values or factories
$di = new Registry(array $values, Registry $delegate); // ... with registry to delegate dependencies
$di[string $classOrInterface] = callable $factory; // stores a factory for abstract
$di[string $key] = mixed $value; // stores a parameter
$di(callable $fn); // call a function resolving it's parameters
$di(callable $fn, array $arguments); // ... with given arguments
$di->freeze(); // disallow to store values or factories
$di->freeze(string $key); // ... for this entry key
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.