PHP code example of qanna-rsa / expression-engine

1. Go to this page and download the library: Download qanna-rsa/expression-engine 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/ */

    

qanna-rsa / expression-engine example snippets


use Qanna\ExpressionEngine\Engine;

$engine = new Engine(config('expression-engine'));

// Fill a template
$engine->resolve('Hello {{ trigger.name }}', [
    'trigger' => ['name' => 'John'],
]);
// → "Hello John"

// Evaluate an expression and get a real typed value back
$engine->evaluate('trigger.items.filter(current.active).map(current.name)', [
    'trigger' => ['items' => [
        ['name' => 'Widget', 'active' => true],
        ['name' => 'Gadget', 'active' => false],
    ]],
]);
// → ["Widget"]
bash
php artisan vendor:publish --tag=expression-engine-config