PHPackages                             dmstr/yii2-widgets2-module - 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. [Templating &amp; Views](/categories/templating)
4. /
5. dmstr/yii2-widgets2-module

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

dmstr/yii2-widgets2-module
==========================

Yii 2.0 Framework Widget Manager

2.8.0(8mo ago)960.1k↓10.7%8[1 issues](https://github.com/dmstr/yii2-widgets2-module/issues)[5 PRs](https://github.com/dmstr/yii2-widgets2-module/pulls)2proprietaryPHPCI failing

Since Apr 5Pushed 6mo ago7 watchersCompare

[ Source](https://github.com/dmstr/yii2-widgets2-module)[ Packagist](https://packagist.org/packages/dmstr/yii2-widgets2-module)[ RSS](/packages/dmstr-yii2-widgets2-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (155)Used By (2)

Yii2 Widget Module
==================

[](#yii2-widget-module)

[![Latest Stable Version](https://camo.githubusercontent.com/0a514dad5d9368fd14a972c92152be4235babc6b67c0caf912b302addb154640/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d77696467657473322d6d6f64756c652f762f737461626c652e737667)](https://packagist.org/packages/dmstr/yii2-widgets2-module)[![Total Downloads](https://camo.githubusercontent.com/a1f740e2dac86218a1a8fe8af186737fbdcc7803b2cd88c5adb15eb1c38cbc02/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d77696467657473322d6d6f64756c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/dmstr/yii2-widgets2-module)[![License](https://camo.githubusercontent.com/bf38d4c867d8ed7f3edf7bf042f83abc4e16c32b255e40beb90b9b47f2e551c4/68747470733a2f2f706f7365722e707567782e6f72672f646d7374722f796969322d77696467657473322d6d6f64756c652f6c6963656e73652e737667)](https://packagist.org/packages/dmstr/yii2-widgets2-module)

Widget manager using twig templates

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require dmstr/yii2-widgets2-module

```

to the require section of your `composer.json` file.

Testing
-------

[](#testing)

```
cd tests

docker-compose up -d

docker-compose run phpfpm bash

setup.sh

```

Config
------

[](#config)

```
...
'modules => [
	'widgets' => [
		'class' => '\hrzg\widget\Module',
		'layout' => '@backend/views/layouts/main',
		'playgroundLayout' => '@frontend/views/layouts/main',
		'dateBasedAccessControl' => true,
		'datepickerMinutes' => false,
		'timezone' => 'Europe/Berlin',
		// set ajax option for JsonEditor
		'allowAjaxInSchema' => false,
        // If true, the json content properties will be validated against the json schema from the widget_template.
        // To be BC the default is false, but you should enable it
		'validateContentSchema' => false
	]
]
...

```

Settings
--------

[](#settings)

`availablePhpClasses``availableFrontendPhpClasses` - Templates with one of the listed classes in this setting will be outputed in cell widgets dropdown for available templates (default: hrzg\\widget\\widgets\\TwigTemplate)

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

### Layout

[](#layout)

Example with `yii2-prototype-module`

- [Yii 2.0 Twig extension](https://github.com/yiisoft/yii2-twig/tree/master/docs/guide)
- [Twig documentation](http://twig.sensiolabs.org/documentation)

```
{{ use ('hrzg/widget/widgets') }}
{{ cell_widget({id: 'main'}) }}

```

### Widget

[](#widget)

- Standard Twig widget `hrzg\widget\widgets\TwigTemplate`
- Char-Rank ordering `001`, `10`, `5`, `aa1`, `aa1.2`, `b0` (not numeric)

### JSON

[](#json)

- [JSON schema editor](https://github.com/jdorn/json-editor)

### Settings

[](#settings-1)

**Section:** widgets

**Key:** availablePhpClasses

**Type:** JSON

\####Example:

`{"hrzg\\widget\\widgets\\TwigTemplate": "Twig layout"}`

### Widget example

[](#widget-example)

#### Basic

[](#basic)

```
{
    "title": "Basic",
    "type": "object",
    "properties": {
        "headline": {
            "type": "string",
            "default": "Avo vole tioma profitanto ts,"
        },
        "text_html": {
            "type": "string",
            "format": "html",
            "default": "Ja sub kiam aliu, fo unt fora danke helpverbo, dev bv tele kibi piedpilko.",
            "options": {
                "wysiwyg": true
            }
        }
    }
}

```

```
{{ headline }}
{{ text_html }}

```

For more examples, please see the [docs](./docs)

Upgrading
---------

[](#upgrading)

### from 0.2 to 0.3

[](#from-02-to-03)

```
{{ cell_widget({id: 'header'}) }}

```

RBAC
----

[](#rbac)

#### Available Permission items

[](#available-permission-items)

NameDescriptionwidgets\_default\_indexWidgets Managerwidgets\_crud\_apiWidgets CRUD APIwidgets\_crud\_widgetWidgets CRUD Contentwidgets\_crud\_widget\_createWidgets CRUD Content Createwidgets\_crud\_widget\_deleteWidgets CRUD Content Deletewidgets\_crud\_widget\_indexWidgets CRUD Content Indexwidgets\_crud\_widget\_updateWidgets CRUD Content Updatewidgets\_crud\_widget\_viewWidgets CRUD Content Viewwidgets\_crud\_widget-templateWidgets CRUD Templatewidgets\_testWidgets TEST Playgroundwidgets-cell-editFrontend editingwidgetsWidgets ModuleSettings
--------

[](#settings-2)

   Section Key Value Type     widgets ckeditor.config ```
    {
      "height": "4000px",
      "toolbar": [
        ["Format"],
        ["Link", "Image", "Table", "-", "NumberedList", "BulletedList", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"],
        ["Source"],
        "/", ["Bold", "Italic", "Underline", "StrikeThrough", "-", "RemoveFormat", "-", "Undo", "Redo", "-", "Paste", "PasteText", "PasteFromWord", "-", "Cut", "Copy", "Find", "Replace", "-", "Outdent", "Indent", "-", "Print"]
      ]
    }
```

  OBJECT/JSON

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance61

Regular maintenance activity

Popularity38

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 63% 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 ~27 days

Recently: every ~123 days

Total

125

Last Release

244d ago

Major Versions

0.6.7 → 2.0.0-alpha12018-07-17

0.6.8 → 2.0.0-alpha32018-10-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b4ab2b6685ec71887908ec8cff261a16cd5bb24c69bb8ab52840e220f175f9d?d=identicon)[schmunk](/maintainers/schmunk)

---

Top Contributors

[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (221 commits)")[![eluhr](https://avatars.githubusercontent.com/u/13000805?v=4)](https://github.com/eluhr "eluhr (83 commits)")[![handcode](https://avatars.githubusercontent.com/u/825574?v=4)](https://github.com/handcode "handcode (22 commits)")[![Kanabanarama](https://avatars.githubusercontent.com/u/1219900?v=4)](https://github.com/Kanabanarama "Kanabanarama (13 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (6 commits)")[![germanbisurgi](https://avatars.githubusercontent.com/u/13135260?v=4)](https://github.com/germanbisurgi "germanbisurgi (4 commits)")[![marc7000](https://avatars.githubusercontent.com/u/1118837?v=4)](https://github.com/marc7000 "marc7000 (1 commits)")[![gbisurgi](https://avatars.githubusercontent.com/u/18024942?v=4)](https://github.com/gbisurgi "gbisurgi (1 commits)")

---

Tags

contenttemplatetwigwidgetsyii2yii2extension

### Embed Badge

![Health badge](/badges/dmstr-yii2-widgets2-module/health.svg)

```
[![Health](https://phpackages.com/badges/dmstr-yii2-widgets2-module/health.svg)](https://phpackages.com/packages/dmstr-yii2-widgets2-module)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[dmstr/yii2-pages-module

Application sitemap and navigation manager module for Yii 2.0 Framework

3177.5k2](/packages/dmstr-yii2-pages-module)[dmstr/yii2-backend-module

Admin Dashboard

1972.4k3](/packages/dmstr-yii2-backend-module)[raoul2000/yii2-bootswatch-asset

Use Bootswatch theme in your Yii application with minimum effort

2145.0k4](/packages/raoul2000-yii2-bootswatch-asset)[zxbodya/yii2-tinymce

Yii2 extension to use TinyMce with Compressor and FileManager

1732.1k3](/packages/zxbodya-yii2-tinymce)

PHPackages © 2026

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