Download the PHP package serafim/boson without Composer
On this page you can find all versions of the php package serafim/boson. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download serafim/boson
More information about serafim/boson
Files in serafim/boson
Informations about the package boson
Boson
Why Boson? Because it's not an Electron! And much easier than that =)
Also, this repository contains included high level PHP bindings for webview v0.12.0.
- Simple Example
- Requirements
- Windows
- Linux & BSD
- Debian
- Fedora
- FreeBSD
- MacOS
- Usage
- Window
- Window Title
- Window Resizing
- Window Max Size
- Window Min Size
- Window Fixed Size
- Window Dark Mode
- WebView
- HTML Content
- Load Content From URL
- Styles
- Global Styles
- JavaScript
- Global Scripts
- Creating Functions
- Code Evaluation
- Code Requests
- Misc
- Quit
- Debug Mode
- Custom Library
Simple Example
Requirements
- PHP ^8.4
- ext-ffi
Platform | X86 | AMD64 | ARM64 | Technologies |
---|---|---|---|---|
Windows | ✓ | ✓ | ✖ (see #1) | Windows API, WebView2 |
Linux | ✓ | ✓ | ✖ (see #1) | GTK, WebKitGTK |
macOS | ✓ | ✓ | ✓ | Cocoa, WebKit |
- It would be nice if you sent a PR with support for this platform:
Windows
Requires Windows 10 or higher.
End-users must have the WebView2 runtime installed on their system for any version of Windows before Windows 11.
Note: A pre-builded version of the bridge already comes with
the portability package in bin/WebView2Loader.dll
. No any
additional installation required.
Linux and BSD
The GTK and WebKitGTK libraries are required. You need to check your package repositories regarding which packages to install.
Debian
WebKitGTK 6.0, GTK 4
WebKitGTK 4.1, GTK 3, libsoup 3
WebKitGTK 4.0, GTK 3, libsoup 2
Fedora
WebKitGTK 6.0, GTK 4
WebKitGTK 4.1, GTK 3, libsoup 3
WebKitGTK 4.0, GTK 3, libsoup 2
FreeBSD
GTK 4
GTK 3
MacOS
It appears that no additional dependencies are required.
Usage
Window Title
To get or update the title, you should change the $title
property
Or set title from configuration
Window Resizing
To change the size, use the resize()
method.
Or set size from configuration
Window Max Size
To change the max size, use the resize()
method.
[Linux/GTK4]: Using
WindowSizeHint::MaxBounds
for setting the maximum window size is not supported with GTK 4 (Linux platform) because X11-specific functions such asgtk_window_set_geometry_hints
were removed. This option has no effect when using GTK 4.
Window Min Size
To change the min size, use the resize()
method.
Window Fixed Size
To set the fixed size, use the resize()
method.
Window Dark Mode
To set the dark mode (dark theme), use the $darkMode
window property.
[Linux]: Currently not supported, this option has no effect
[MacOS]: Currently not supported, this option has no effect
Or set dark mode from configuration
WebView HTML Content
To set the content, you should use the $html
property
Or set html content from configuration
Please note that reading this property is NOT possible. If you need to read the contents, use the data retrieval method.
WebView URL
To load content from the URL, you should use the $url
property
Or set URL from configuration
Global Styles
You can register a CSS style that will be applied to any page
Or set styles from configuration
Global Scripts
You can register a JavaScript code that will be applied to any page
Or set scripts from configuration
Creating Functions
You can create a function that can be called directly from WebView
Or set functions list from configuration
Code Evaluation
You can execute arbitrary code directly on current WebView
Code Requests
You can directly get data from WebView context
Quit
To exit the application, you should call the quit()
method
Debug Mode
To enable debug mode, you should define the debug: ?bool
argument of the Application
instance.
Custom Library
To define binary, you should define the library: ?non-empty-string
argument of the Application
instance.