Winbox.js wrapper in PHP.

Overview

Winbox PHP

A wrapper for using Winbox.js just coding in PHP. Based on:

WinBox.js: HTML5 Window Manager for the Web.

JS Repo - https://github.com/nextapps-de/winbox

Installation

Clone the repo or use Composer composer require carloswph/winbox-php

Usage

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>

Methods

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

To-do

  • Add custom behaviours to the windows, through the trait On(), as well as allowing a programatic control of the windows features.
  • Create an additional class to set custom CSS, icons and scrollbars to be configured.
You might also like...
A wrapper package to run mysqldump from laravel console commands.

A wrapper package to run mysqldump from laravel console commands.

Laravel wrapper for the Gmail API

Laravel Gmail Gmail Gmail API for Laravel 8 You need to create an application in the Google Console. Guidance here. if you need Laravel 5 compatibilit

Simple and ready to use API response wrapper for Laravel.
Simple and ready to use API response wrapper for Laravel.

Laravel API Response Simple Laravel API response wrapper. Installation Install the package through composer: $ composer require obiefy/api-response Re

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite

Mollie for Laravel Laravel-Mollie incorporates the Mollie API and Mollie Connect into your Laravel or Lumen project. Accepting iDEAL, Apple Pay, Banco

Laravel wrapper for zendesk/zendesk_api_client_php package.

Laravel Zendesk This package provides integration with the Zendesk API. It supports creating tickets, retrieving and updating tickets, deleting ticket

A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.
A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the CoinDCX API and allows you to easily communicate with it. Important Note This package is in early deve

A DOMPDF Wrapper for Laravel

DOMPDF Wrapper for Laravel Laravel wrapper for Dompdf HTML to PDF Converter Require this package in your composer.json and update composer. This will

A Laravel wrapper for apex charts

Larapex Charts A Laravel wrapper for apex charts library Check the documentation on: Larapex Chart Docs. Installation Use composer. composer require a

Laravel SoapClient Wrapper

Laravel SoapClient Wrapper A SoapClient wrapper integration for Laravel. Makes it easy to use Soap in a Laravel application. Please report any bugs or

Releases(1.0.0)
Owner
null
Laravel wrapper to use Lightship PHP

lightship-laravel Laravel wrapper to use Lightship PHP. Summary About Features Installation Examples Tests About Lightship is a way to get web page au

Lightship 3 Dec 11, 2022
A CommonMark wrapper for Laravel

Laravel Markdown Laravel Markdown was created by, and is maintained by Graham Campbell, and is a CommonMark wrapper for Laravel. It ships with integra

Graham Campbell 1.2k Jan 2, 2023
Laravel wrapper package for the Aimon.it API

Laravel Aimon Package A laravel wrapper package for the Aimon.it API. For more information see Aimon Requirements Laravel 6 or later Installation Inst

Ruslan 3 Aug 7, 2022
PayuMoney Gateway wrapper for Laravel.

PayuMoney Integration with Laravel Easy to use integration for PayUMoney into Laravel apps. Video Tutorial Usage composer require infyomlabs/laravel-p

InfyOmLabs (InfyOm Technologies) 10 Nov 29, 2022
A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.

Astrotomic 22 Nov 17, 2022
Laravel API wrapper to interact fluently with your Janus Media Server

Laravel API wrapper to interact fluently with your Janus Media Server. Core server interactions, as well as the video room plugin included.

Richard  Tippin 11 Aug 21, 2022
A laravel wrapper for BnpParibas Mercanet payment gateway

Laravel Mercanet A laravel wrapper for BnpParibas Mercanet which provide a lightweight public api to process your online payments from your laravel ap

Mouad ZIANI 29 Nov 27, 2022
Open Food Facts API wrapper for Laravel

Laravel Open Food Facts API This package provides a convenient wrapper to the Open Food Facts API for Laravel applications (5.7+). Installation You ca

Open Food Facts 112 Jan 4, 2023
a Google API v3 wrapper for Laravel 4.x

A Google API v3 wrapper for Laravel 4 This package enables a Laravel flavoured way to manage Google services through its API interface (v3) Installati

null 4 Nov 29, 2022
Laravel wrapper for Sentry Official API

Laravel Sentry API Provides a simple laravel wrapper to some of the endpoints listed on (Official Sentry API)[https://docs.sentry.io/api/]. **Note: Th

Pedro Santiago 1 Nov 1, 2021