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↓50%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 1mo 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

33

—

LowBetter than 75% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity20

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

582d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9153207646a2b8a1d57ade7c92fa6d88a826ccb115ff60ca8776b32b877245e1?d=identicon)[mvenghaus](/maintainers/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.4k902.6M1.8k](/packages/nikic-php-parser)[doctrine/lexer

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

11.2k910.8M118](/packages/doctrine-lexer)[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/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.5k23.5M111](/packages/matomo-device-detector)

PHPackages © 2026

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