PHP Classes

File: examples/examplevariable.php

Recommend this page to a friend!
  Classes of Jorge Castro   PHP Mini Language   examples/examplevariable.php   Download  
File: examples/examplevariable.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Mini Language
Execute string of a simple language conditions
Author: By
Last change:
Date: 4 years ago
Size: 560 bytes
 

Contents

Class file image Download
<?php
use eftec\minilang\MiniLang;

include
"../lib/MiniLang.php";
$variables=['field1'=>12345,'field2'=>0]; // we define regular variables
$callback=new stdClass();

$mini=new MiniLang($callback,$variables);
$mini->separate("fieldtxt='123 {{field1}} {{field1}}' when field1>0 then field2+2"); // we prepare the language

echo "\n";
var_dump(end($mini->where));
echo
"\n";
var_dump(end($mini->set));
echo
"\n";
var_dump(end($mini->init));


$mini->evalAllLogic(false,true); // we set the variables and run the languageand run the language
var_dump($variables);