PHP code example of refactor73 / autotextgen
1. Go to this page and download the library: Download refactor73/autotextgen 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/ */
refactor73 / autotextgen example snippets
$context = Context::fromArray([
'trend' => 10,
'total' => 90,
]);
$decisionTable = DecisionTable::fromArray([
'isNegative' => false,
]);
$textComposer = new TextComposer($decisionTable, $context);
$result = $textComposer->compose(
'{In dieser Woche|Aktuell} ist der Wert um ${trend} auf ${total} Punkte ' .
'[IF $isNegative] gefallen [ELSE] gestiegen [ENDIF].'
);