Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 172 | All time: 8,819 This week: 46 |
Version | License | PHP version | Categories | |||
winbox-php 1.0.0 | GNU General Publi... | 5.6 | HTML, PHP 5, GUI |
Description | Author | |||
This package can generate HTML to show draggable windows on a page. Innovation Award
|
A wrapper for using Winbox.js just coding in PHP. Based on:
<h1>
<img src="https://cdn.jsdelivr.net/gh/nextapps-de/winbox@master/demo/winbox.png" alt="WinBox.js: HTML5 Window Manager for the Web." width="100%">
</h1>
Clone the repo or use Composer composer require carloswph/winbox-php
Using this wrapper is actually pretty simple and can be done by just using two different classes. The class Init() provides a static method that adds Winbox.js bundle, allowing new windows to be created. Once the bundle is running, new windows can be added by instances of the class Window(), and respective window name as arguments, and its options.
The options can be either set by a number of different methods or passed while creating the instance as an array. When using the Init::enqueue() static method, a boolean can be passed optionally. If true, Winbox PHP will actually enqueue the Winbox bundle from a local repository, rather than the CDN link.
require __DIR__ . '/vendor/autoload.php';
?>
<head>
<?php
Winbox\Init::enqueue(); // Adds Winbox.js bundle.
$wb = new Winbox\Window("Winbox Test");
$wb->setBorder(4); // Sets the winbox border thickness
?>
</head>
<body>
<?php $wb->render(); ?>
</body>
setBorder($thickness)
- accepts integer or strings, corresponding to any CSS unit (px, for instance)
setColor($color
- admits any valid CSS color and determines the window's border background
setViewport($viewport)
- admits a single integer or string, or an array of measure (2, 3 or 4 values), corresponding to top, bottom, right and left viewport sizes
setPosition($x, $y)
- each of the axis variables can be a single value, or an array of two values or strings ([x, width] and [y, height])
isModal()
- if called, the winbox behaves as a modal box
setInner($html)
- sets any HTML code to appear inside the winbox
setID($ID)
- sets the winbox ID
setClass($class)
- sets the winbox CSS class
render()
- renders the winbox final result
Files (8) |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
src (3 files, 1 directory) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
README.md | Doc. | Read me |
Files (8) | / | src |
File | Role | Description | ||
---|---|---|---|---|
assets (1 file) | ||||
Init.php | Class | Class source | ||
On.php | Class | Class source | ||
Window.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.