# PHP WebView
**Php WebView Library**
PHP bindings for [zserge's Webview](https://github.com/webview/webview)
## Installation
```shell
composer require 0hr/php-webview
```
## Examples
### Hello World Application [Example](https://github.com/0hr/php-webview/tree/main/examples/helloworld)
```php
#!/usr/bin/env php
<?php
require_once './vendor/autoload.php';
use PhpWebView\WebView;
use PhpWebView\WindowSizeHint;
$webview = new WebView('Php WebView', 480, 320, WindowSizeHint::HINT_NONE, true);
$webview->setHTML('<center> Hello World </center>');
$webview->run();
$webview->destroy();
```
<img src="examples/helloworld/helloworld.png" width="330px">
### Bindings [Example](https://github.com/0hr/php-webview/tree/main/examples/bindings)
```php
$webview->bind('save', function ($seq, $req, $context) use (&$list) {
$name = $req[0];
$lastname = $req[1];
if (empty($name) || empty($lastname)) {
return ['name' => empty($name), 'lastname' => empty($lastname)];
} else {
$list[] = ['name' => $name, 'lastname' => $lastname];
}
return [];
});
$webview->bind('getList', function ($seq, $req, $context) use ($webview, &$list) {
$webview->returnValue($seq, 0, $list);
});
```
<img src="examples/bindings/binding.png" width="330px">
## Building
For prerequisites, read [The link](https://github.com/webview/webview#prerequisites)
To build the library, run **src/webview/build.sh** on Unix-based systems, **src/webview/build.bat** on Windows
没有合适的资源?快使用搜索试试~ 我知道了~
php直接生成html的解决方案
共27个文件
php:6个
sh:3个
png:3个
需积分: 5 0 下载量 199 浏览量
2024-03-19
14:12:31
上传
评论
收藏 663KB ZIP 举报
温馨提示
php直接生成html的解决方案
资源推荐
资源详情
资源评论
收起资源包目录
php-webview-main.zip (27个子文件)
php-webview-main
src
webview
build.bat 3KB
webview_php.h 124B
webview.h 76KB
webview_php.c 25B
webview.cc 20B
build.sh 805B
webview_php.h 5KB
build
macos
webview_php_ffi.dylib 258KB
linux
webview_php_ffi.so 169KB
windows
webview_php_ffi.dll 197KB
WebView2Loader.dll 138KB
webview.obj 771KB
Context.php 253B
WebView.php 5KB
WindowSizeHint.php 152B
Exceptions
OsException.php 381B
composer.json 323B
examples
helloworld
helloworld.sh 62B
main.php 289B
helloworld.png 72KB
bindings
main.php 776B
binding.sh 62B
binding.png 199KB
views
main.html 3KB
img
example.png 69KB
.gitignore 47B
README.md 1KB
共 27 条
- 1
资源评论
PHP代码
- 粉丝: 1w+
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功