PHP code example of bytehello / condition-builder
1. Go to this page and download the library: Download bytehello/condition-builder 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/ */
bytehello / condition-builder example snippets
use ByteHello\ConditionBuilder\Builder;
use ByteHello\ConditionBuilder\Condition\AndConditionGroup;
use ByteHello\ConditionBuilder\Condition\OrConditionGroup;
use ByteHello\ConditionBuilder\ConditionConfig\ConfigData;
ConditionG1->addMultiple(
[
new ConfigData('Test', 'check3'),
$andConditionG1
]
);
$andConditionG2 = new AndConditionGroup();
$andConditionG2->addMultiple([
new ConfigData('Test', 'check4'),
new ConfigData('Test', 'check5'),
$orConditionG1
]);
$node = Builder::generateCode($andConditionG2);
echo Builder::getPrintedStatements($node);
echo PHP_EOL;