PHPackages                             elendev/widget-bundle - 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. elendev/widget-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

elendev/widget-bundle
=====================

Provide simple widget management

0.4.1(9y ago)44932[1 issues](https://github.com/Elendev/ElendevWidgetBundle/issues)Apache2PHP

Since Feb 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Elendev/ElendevWidgetBundle)[ Packagist](https://packagist.org/packages/elendev/widget-bundle)[ Docs](http://blog.elendev.com)[ RSS](/packages/elendev-widget-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (4)Versions (12)Used By (0)

ElendevWidgetBundle
===================

[](#elendevwidgetbundle)

The ElendevWidgetBundle allow to add widgets (independent HTML code) into existing templates withouth dependencies.

Installation
------------

[](#installation)

The ElendevWidgetBundle is available through composer. You just have to add elendev/widget-bundle into your composer.json.

Configuration
-------------

[](#configuration)

```
elendev_widget:
	enable_annotations:   true # false : disable annotation support
	scan_services:        true # false : don't check annotations on services
	scan_widget_directory:  true # false : don't scan Widget directory
	widget_directory:     'Widget' # name of the widget directory at bundle's root
	hinclude:
		force: none              	# Force use of hinclude
									# none       : use widgets to load synchronous widget, widgets_async to load them asynchronously
									# enabled    : force widgets method to load asynchronously using hinclude
									# disabled   : force widgets_asynch method to load synchronously

```

Register a new widget
---------------------

[](#register-a-new-widget)

A widget is a service method returning simple HTML code. You only have to tag your service method with :

```
tags:
        - {name: elendev.widget, tag: your_tagname, method: method_name, priority: optional_integer_priority}

```

Annotations are also available, you can annotate any method of a service or of a class in `widget_directory` sub-directory.

```
namespace Acme\DemoBundle\Widget;
use Elendev\WidgetBundle\Annotation\Widget;

class MyTestWidget {
	/**
 	* @Widget(tag="main", priority=99)
 	*/
	public function myYoupiWidget(){
		return "This is a simple widget";
	}
}

```

The value of widget is by default the tag value. Widgets in `widget_directory` sub-directory are instanciated as services and support the `ContainerAwareInterface` interface (container is automatically injected).

Use Twig's extension widget method
----------------------------------

[](#use-twigs-extension-widget-method)

To include widgets in a view you only have to call this method :

`{{ widgets('your_tagname') }}`

It's possible to use hinclude :

`{{ widgets_async('your_tagname') }}`

**BE CAREFUL : only scalar parameters can be passed to widgets\_async method.**To enable hinclude, please refer to symfony's documentation : .

You can add multiple widgets emplacements in your project, specifieds by their `tagname`.

Some widget's emplacements can provide parameters. You can add as much parameters as you need to `widgets` call, they will be passed to the widget.

```
#services.yml
services:
    my_service:
        class: Some/Class/MyWidgets
            tags:
                - {name: elendev.widget, method: memberDatas, tag: member_profile}

```

---

```
{# Template twig #}
{{ widgets('member_profile', member) }}

```

---

```
//PHP code
class MyWidgets{
    public function memberDatas(Member $member){
        return 'some templates';
    }
}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~148 days

Recently: every ~267 days

Total

11

Last Release

3399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f3d01822621b80f6102d24f68e9a0ff2221d98a272ccd5c78c405d19621f475?d=identicon)[Elendev](/maintainers/Elendev)

---

Top Contributors

[![Elendev](https://avatars.githubusercontent.com/u/1331273?v=4)](https://github.com/Elendev "Elendev (18 commits)")

---

Tags

widgettwing filter

### Embed Badge

![Health badge](/badges/elendev-widget-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/elendev-widget-bundle/health.svg)](https://phpackages.com/packages/elendev-widget-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[symfony/ai-bundle

Integration bundle for Symfony AI components

32642.2k24](/packages/symfony-ai-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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