PHP code example of kkphoenix / panteao

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

    

kkphoenix / panteao example snippets



use Panteao\Panteao;

$engine = new Panteao("./project.jcm");
$engine->connect();

$engine->registerAction("turn_on_ac", function($sender, $receiver, $content) use ($engine) {
    echo "Action received! Turning on AC.";
    $engine->sendMsg("tell", "my_app", $sender, "ac_status(on)");
});

$engine->sendMsg("tell", "my_app", "bob", "temperature(room_1, 35)");
$engine->loop();