PHP code example of kingbes / webui
1. Go to this page and download the library: Download kingbes/webui 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/ */
kingbes / webui example snippets
use Kingbes\Webui;
use Kingbes\JavaScript;
$Webui = new Webui;
$html = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . "index.html");
$window = $Webui->newWindow();
$bind = $Webui->bind($window, "hello", function ($event, JavaScript $js) {
// Gets the first argument as a string
$arg_one = $js->getString($event);
var_dump($arg_one);
// return string
$js->returnString($event, "nihao");
});
$Webui->show($window, $html);
$Webui->wait();
$Webui->clean();