PHPackages                             humweb/widgets - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. humweb/widgets

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

humweb/widgets
==============

Widgets package

2.0(1y ago)022.4k↓76.4%1MITPHPPHP &gt;=5.3.0

Since Jun 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/humweb/widgets)[ Packagist](https://packagist.org/packages/humweb/widgets)[ Docs](https://github.com/humweb/widgets)[ RSS](/packages/humweb-widgets/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (1)

Widgets
=======

[](#widgets)

[![Build Status](https://camo.githubusercontent.com/f66e30dafc051c5667c576bdb285021272463245aa23d3f038f4a0619af518fc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68756d7765622f776964676574732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/humweb/widgets)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8471a77f1cac8081deaaf33c91c0fd78f771d6375fcee749b909332929c11dd0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68756d7765622f776964676574732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/humweb/widgets/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/aaafd30ff0e7bac54c24d63d86babbde8819d4cb76d859a3eaaa1382687f0373/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68756d7765622f776964676574732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/humweb/widgets/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/40a72cbe5cb5c4adab0a52b125c146d43605694e2102768bf0d4ad8ded4d31dc/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62336231396262372d336432392d343461632d626135312d6438333732336231306136662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/b3b19bb7-3d29-44ac-ba51-d83723b10a6f)[![Total Downloads](https://camo.githubusercontent.com/b76b7850602f9e781c52c2853cff1c31eb3cd170cdcdc14bfffdb0738109da9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68756d7765622f776964676574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/humweb/widgets)[![Latest Version on Packagist](https://camo.githubusercontent.com/ea55d7bc1c7a3d32346896c82a7a17b5ebbfd010e7ffd2e5e1f5785d54780464/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68756d7765622f776964676574732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/humweb/widgets)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Install
-------

[](#install)

Via Composer

```
$ composer require humweb/widgets
```

Usage
-----

[](#usage)

**Register anonymous function handler**

```
$widgets = new WidgetFactory();

$widgets->register('foo', function($val = '') {
    return 'bar'.$val;
});

echo $widgets->foo('baz');
```

**Register class handler**

```
$widgets = new WidgetFactory();

$widgets->register('foo', 'Humweb\Widgets\Tests\Fake\FooWidget@render');
// or
// $widgets->register('foo', 'Humweb\Widgets\Tests\Fake\FooWidget');

// Check for registered widget
$this->widgets->has('foo');

// Renders
echo $this->widgets->foo();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ryan Shofner](https://github.com/ryun)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance42

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1177 days

Total

4

Last Release

475d ago

Major Versions

1.2 → 2.02025-03-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b536bae26e43306745d195a34b8dff510bc05419cdc3503f96c5cb3fd4e7239?d=identicon)[ryun](/maintainers/ryun)

---

Top Contributors

[![ryun](https://avatars.githubusercontent.com/u/227672?v=4)](https://github.com/ryun "ryun (30 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

widgetshumweb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/humweb-widgets/health.svg)

```
[![Health](https://phpackages.com/badges/humweb-widgets/health.svg)](https://phpackages.com/packages/humweb-widgets)
```

###  Alternatives

[silverstripe/widgets

Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.

37423.2k20](/packages/silverstripe-widgets)[asinfotrack/yii2-toolbox

Yii2-Toolbox is a collection of useful helpers, widgets etc. extending the basic functionality of Yii2

1231.0k5](/packages/asinfotrack-yii2-toolbox)[mdmsoft/yii2-widgets

Widgets for Yii2

178.4k](/packages/mdmsoft-yii2-widgets)[wpbp/widgets-helper

A class to ease creating powered Widgets on WordPress

1215.1k](/packages/wpbp-widgets-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
