PebView
A cross-platform webview component that displays HTML content in native GUI windows. It lets you use web technologies in desktop applications while hiding the fact that the GUI relies on a browser. / 一个跨平台 webview 组件,允许在原生 GUI 窗口中展示 HTML 内容,让您在桌面应用中使用 WEB 技术,同时隐藏 GUI 依赖浏览器的事实。
要求
- PHP 8.2 或更高版本
- PHP-FFI 扩展 / pebview ext
- Composer
- Windows x86_64
- Linux x86_64 或 arrch64
- MacOS x86_64 或 arm64
安装
composer require kingbes/pebview
示例
// 根据你的实际情况,修改下面的路径
require "/vendor/autoload.php";
use Kingbes\PebView\Window; // 引入 Window 类
// 创建一个窗口
$win = new Window();
$win->setTitle("PebView") // 设置窗口标题
->setHtml( // 设置窗口的 HTML 内容
<<<HTML
<h1>hello PebView!</h1>
HTML)
// 运行窗口
->run()
// 销毁窗口
->destroy();

编译
有关先决条件,请阅读文件
./source/build.cmd // windows
./source/linux.sh // linux
./source/macos.sh // macos