1. Go to this page and download the library: Download flashytime/container 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/ */
flashytime / container example snippets
use Flashytime\Container\Container;
$container = new Container();
interface FooInterface
{
}
class Foo implements FooInterface
{
private $name;
private $age;
public function __construct($name = null, $age = 0)
{
$this->name = $name;
$this->age = $age;
}
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
public function setAge($age)
{
$this->age = $age;
}
public function getAge()
{
return $this->age;
}
}
class Bar
{
public $foo;
public function __construct(FooInterface $foo)
{
$this->foo = $foo;
}
public function getFoo()
{
return $this->foo;
}
}