1. Go to this page and download the library: Download cloudson/gandalf 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/ */
cloudson / gandalf example snippets
class Baggin
{
}
$bilbo = new Baggin;
$bilbo->hasRing = true;
var_dump($bilbo->hasRing); // true
class Elf
{
}
$legolas = new Elf;
$legolas->attack = function () {
echo 'Goooo!';
};
$legolas->attack(); // Fatal error: Call to undefined method Elf::attack()
class Elf
{
use Gandalf\Entity\Caller;
}
$legolas = new Elf;
$legolas->attack = function () {
echo 'Goooo!';
};
$legolas->attack(); // Goooo! =)