PHPackages                             mvenghaus/magento2-widget-directive - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. mvenghaus/magento2-widget-directive

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

mvenghaus/magento2-widget-directive
===================================

Simple parser &amp; build for Magento 2 widget directives outside of the Magento environment.

1.1.0(1y ago)02.8k↓91.7%MITPHPPHP ^8.2

Since Mar 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mvenghaus/magento2-widget-directive)[ Packagist](https://packagist.org/packages/mvenghaus/magento2-widget-directive)[ Docs](https://github.com/mvenghaus/magento2-widget-directive)[ RSS](/packages/mvenghaus-magento2-widget-directive/feed)WikiDiscussions main Synced 3d ago

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

Magento 2 - Widget Directive
============================

[](#magento-2---widget-directive)

Simple parser &amp; builder for Magento 2 widget directives outside of the Magento environment.

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

[](#installation)

Install the package via composer:

```
composer require mvenghaus/magento2-widget-directive:"^1.0"
```

Usage
=====

[](#usage)

Parse directives from a string
------------------------------

[](#parse-directives-from-a-string)

```
$content = properties);
}
```

Building a directive
--------------------

[](#building-a-directive)

```
$widgetBuilder = new \Mvenghaus\Magento2WidgetDirective\WidgetBuilder();

$result = $widgetBuilder->build(
    new WidgetData(
       type: '\\TestWidget\\Widget',
       properties: [
           'param1' => 'foo',
           'param2' => 'bar'
        ]
    )
);

// -> {{widget type="TestWidget\Widget" param1="foo" param2="bar"}}
```

Run Tests
---------

[](#run-tests)

```
composer test
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~106 days

Total

3

Last Release

628d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6408081?v=4)[mvenghaus](/maintainers/mvenghaus)[@mvenghaus](https://github.com/mvenghaus)

---

Top Contributors

[![mvenghaus](https://avatars.githubusercontent.com/u/6408081?v=4)](https://github.com/mvenghaus "mvenghaus (8 commits)")

---

Tags

parsermagentobuilderreaderwidgetmagento2directive

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/mvenghaus-magento2-widget-directive/health.svg)

```
[![Health](https://phpackages.com/badges/mvenghaus-magento2-widget-directive/health.svg)](https://phpackages.com/packages/mvenghaus-magento2-widget-directive)
```

###  Alternatives

[nikic/php-parser

A PHP parser written in PHP

17.4k954.1M2.5k](/packages/nikic-php-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k960.0M160](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.1k156.8M870](/packages/erusev-parsedown)[masterminds/html5

An HTML5 parser and serializer.

1.8k269.7M322](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k211.0M75](/packages/sabberworm-php-css-parser)[matomo/device-detector

The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.

3.5k26.4M183](/packages/matomo-device-detector)

PHPackages © 2026

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