sauls/widget

Simple but powerful widget system for PHP

v1.0.8 2020-08-22 19:27 UTC

This package is auto-updated.

Last update: 2024-12-23 04:52:26 UTC


README

Build Status Packagist Total Downloads Coverage Status Scrutinizer Code Quality License

Simple but powerful widget system for PHP

Requirements

PHP >= 7.4 Twig ^3.0

Installation

Using composer

$ composer require sauls/widget

Apppend the composer.json file manually

{
    "require": {
        "sauls/widget": "^1.0"
    }
}

FAQ

What is this all about?

This library allows you to crate a standalone, reusable widgets that can be highly customizable for better user-interfaces.

What it lacks?

  • Assets - At the moment it does not have a js and css management support, but support for js and css is planned in future versions.

  • Integrations - At the moment this library has only twig template engine integration.

What is a Widget?

Widget is a standalone, reusable and highly customizable class that can be used anywhere in the view multiple times with different configurations. There is two types of widgets:

  • Widget
  • ViewWidget

What is a View?

View - is a class that knows how to render widget output.

Default Views

  • NullView
  • StringView
  • PhpFileView
  • TwigView

Documentation

Keep in mind that this documentation is work in progress as it takes some time to properly write it. At the moment if you don't know where to start looking at the tests folder would be a good start.

How-to`s

Integrations

  • Twig

If you are using different template engine, and find this library useful feel free to create a pull request with your template engine integration!