
# WebUI for PHP
[build-status]: https://img.shields.io/github/actions/workflow/status/webui-dev/webui/ci.yml?branch=main&style=for-the-badge&logo=githubactions&labelColor=414868&logoColor=C0CAF5
[last-commit]: https://img.shields.io/github/last-commit/webui-dev/webui?style=for-the-badge&logo=github&logoColor=C0CAF5&labelColor=414868
[release-version]: https://img.shields.io/github/v/tag/webui-dev/webui?style=for-the-badge&logo=webtrees&logoColor=C0CAF5&labelColor=414868&color=7664C6
[license]: https://img.shields.io/github/license/webui-dev/webui?style=for-the-badge&logo=opensourcehardware&label=License&logoColor=C0CAF5&labelColor=414868&color=8c73cc
[![][build-status]](https://github.com/webui-dev/webui/actions?query=branch%3Amain)
[![][last-commit]](https://github.com/webui-dev/webui/pulse)
[![][release-version]](https://github.com/webui-dev/webui/releases/latest)
[![][license]](https://github.com/webui-dev/webui/blob/main/LICENSE)
>Use any web browser or WebView as GUI, with your preferred language in the backend and modern web technologies in the frontend, all in a lightweight portable library.

[中文自述](/README-zh-CN.md)
# composer
```shell
composer require kingbes/webui
```
| require | |
| ---- | ---- |
| PHP | 8.1+ |
| FFI | * |
| Windows-x64 | true |
| Linux-x64 | true |
| Linux-arm | To be tested |
| Linux-arm64 | To be tested |
| MacOs-x64 | To be tested |
| MacOs-arm64 | To be tested |
# example
1. Example I
index.html
```html
Document
```
index.php
```php
require "./vendor/autoload.php";
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();
```
## Various usage instructions
1. `Webui` Webui class
2. `JavaScript` Used to interact with js bindings
3. `Wrapper` Wrappers that wrap the entire interaction, etc
4. `Cobj` Wrappers, which wrap the entire interaction with other C object classes, some functions may be required
# MORE
[website](https://webui.me/)