PHP code example of eden / core

1. Go to this page and download the library: Download eden/core 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/ */

    

eden / core example snippets


eden('YOUR\\CLASS\\NAME', 123, array('foo' => 'bar'), 'abc');

eden()->Your_Class_Name(123, array('foo' => 'bar'), 'abc'));

class Foo extends \Eden\Core\Base 
{
    protected $zoo = 4;
    
    public function bar()
    {
        $this
            ->loop(function($i) {
                if($i === 5) {
                    return false;
                }
                
                $this->zoo += $i;
            })
            ->when($this->zoo > 10, function() {
                echo $this->zoo;
            });
    }
}

class Foo extends \Eden\Core\Base 
{
    public function bar()
    {
        $this('bar');
    }
}

eden()->addMethod('output', function($string) {
    echo $string;
    return $this;
});

eden()->inspect('Hello World');

eden()->inspect([mixed $property = $this]);

eden()->loop(
    function($i) {
        if($i < 4) {
            return;
        }
        
        return false;
    }, 2);

eden()->on('complete', function($string, $number) {
    echo $string . ' ' . $number;
});