PHP code example of frozzare / tank
1. Go to this page and download the library: Download frozzare/tank 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/ */
frozzare / tank example snippets
use Frozzare\Tank\Container;
class Plugin_Loader extends Container {
public function __construct() {
$this->bind( 'number', 12345 );
}
}
$loader = new Plugin_Loader;
echo $loader->make( 'number' );
// 12345
use Frozzare\Tank\Container;
use Frozzare\Tank\Service_Provider;
class Example_Provider extends Service_Provider {
public function register() {
$this->container->bind( 'say', 'Hello!' );
}
}
$container = new Container;
$provider = new Example_Provider( $container );
$provider->register();
echo $container->make( 'say' );
// Hello!