PHP code example of aviator / delegate
1. Go to this page and download the library: Download aviator/delegate 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/ */
aviator / delegate example snippets
public function __get ($name)
{
if ($name === 'foo') {
return $this->getFooDelegate()
}
}
private function getFooDelegate ()
{
return new Delegate($this->someMember, function ($collection, $name) {
return $collection->get($name);
}
}