PHP code example of danielgsims / staticproxy
1. Go to this page and download the library: Download danielgsims/staticproxy 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/ */
danielgsims / staticproxy example snippets
class MyController
{
private $validator;
public function __construct(StaticProxy $validator)
{
$this->validator = $validator;
}
public function index(Request $request)
{
$this->validator->validate($request);
}
}
class MyController
{
private $validator;
public function __construct(Acme\Validator $validator)
{
$this->validator = $validator;
}
public function index(Request $request)
{
$this->validator->validate($request);
}
}
$a = new Aliaser;
$a->register("Acme\Validator");
$s = new StaticProxy("Foo");
$c = new MyController($s);