PHP code example of bentools / treerex

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

    

bentools / treerex example snippets


use BenTools\TreeRex\Factory\FlowchartYamlFactory;
use BenTools\TreeRex\Runner\FlowchartRunner;
use BenTools\TreeRex\Runner\RunnerContext;

$flowchart = new FlowchartYamlFactory()->parseYamlFile(__DIR__.'/config/user_can_edit_post.yaml');
$runner = new FlowchartRunner();
$context = new RunnerContext(['post' => $post]); // <-- will be merged with `