PHPackages                             quanzo/yii2-blocks - 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. quanzo/yii2-blocks

ActiveLibrary[Templating &amp; Views](/categories/templating)

quanzo/yii2-blocks
==================

Organize the output of content blocks on the site. Module for Yii2

1.0.0(6y ago)01MITPHPPHP &gt;=7.0

Since Sep 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/quanzo/yii2-blocks)[ Packagist](https://packagist.org/packages/quanzo/yii2-blocks)[ RSS](/packages/quanzo-yii2-blocks/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Blocks - module for Yii2
========================

[](#blocks---module-for-yii2)

The module is designed to display content blocks on the site. Blocks are created in the database. Grouped by name. And sorted by index.

For example, you can organize a block of several banners under the site menu. Or blocks of links in the footer of the site.

Block restriction on display is supported

- by route
- by role &amp; rule

You can show guests one block, and administrators another.

\-----------------------------------------

Модуль предназначен для вывода на сайт блоков контента. Блоки создаются в базе данных. Группируются по имени. И сортируются по индексу.

Например, можно организовать блок из нескольких баннеров под меню сайта. Или блоки ссылок в футере сайта.

Поддерживается ограничение на показ каждого блока

- по route
- по правам доступа

Можно показать гостям один блок, а администраторам другой.

\-----------------------------------------

Install
=======

[](#install)

Use composer

```
composer require "quanzo/yii2-blocks"

```

or add in section *require* in *composer.json*

```
"quanzo/yii2-blocks": "*"

```

Install both db migrations.

Configure
---------

[](#configure)

```
$config = [
    'modules' => [
        'blocks' => [
            'class' => 'x51\yii2\modules\blocks\Module'
        ],
    ],
];

```

Create role **blocks\_manage** in rbac.

Add the role to the user who is allowed to edit.

How use
-------

[](#how-use)

```
echo \x51\yii2\modules\blocks\widgets\Group::widget([
    'group' => 'sidebar', // group name
    'order' => 'ASC', // direction of sorting blocks in a group
    'before' => '', // output content before group
    'after' => '', // output content after group
    'beforeElement' => '', // display content before each element
    'afterElement' => '' // display content after each element
]);

```

Picture
-------

[](#picture)

[![List](pic/blocks_1.png)](pic/blocks_1.png)

[![Update or add form](pic/blocks_2.png)](pic/blocks_2.png)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2445d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

yii2blocksContent Blocks

### Embed Badge

![Health badge](/badges/quanzo-yii2-blocks/health.svg)

```
[![Health](https://phpackages.com/badges/quanzo-yii2-blocks/health.svg)](https://phpackages.com/packages/quanzo-yii2-blocks)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[wbraganca/yii2-fancytree-widget

The yii2-fancytree widget is a Yii 2 wrapper for the \[Fancytree\](https://github.com/mar10/fancytree). A JavaScript dynamic tree view plugin for jQuery with support for persistence, keyboard, checkboxes, tables, drag'n'drop, and lazy loading

45132.0k4](/packages/wbraganca-yii2-fancytree-widget)[ogheo/yii2-htmlcompress

Compress HTML output into a single line

20184.4k1](/packages/ogheo-yii2-htmlcompress)[marqu3s/yii2-summernote

Yii2 Summernote widget. Super simple WYSIWYG editor on Bootstrap

1691.6k8](/packages/marqu3s-yii2-summernote)[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)
