PHP code example of softius / phlow

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

    

softius / phlow example snippets

 php
$builder = new WorkflowBuilder();
$builder
  ->start()
  ->choice()
  ->when('isPluggedIn')
    ->callback()          // Plug in lamp
  ->when('isBurnedOut')
    ->callback()          // Replace lamp
  ->otherwise()
    ->callback()          // Repair lamp
  ->endAll()
 php
$workflow = $builder->getWorkflow();
$instance = new WorkflowInstance($workflow, $data);
$instance->execute();