PHPackages                             zlatov/yii-components - 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. [Framework](/categories/framework)
4. /
5. zlatov/yii-components

AbandonedArchivedLibrary[Framework](/categories/framework)

zlatov/yii-components
=====================

Некоторые дополнения для yii2

1.1.2(9y ago)025MITPHPPHP &gt;=5.4.0

Since Mar 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Zlatov/yii-components)[ Packagist](https://packagist.org/packages/zlatov/yii-components)[ RSS](/packages/zlatov-yii-components/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

yiiComponents
=============

[](#yiicomponents)

1. Поведения (behaviors)
    - [Sid](#beh_sid)
2. Примеси (traits)
    - [Sid](#tra_sid)
    - [Tree](#tra_tree)
3. Виджеты (widgets)
    - [ViewTree](#wid_viewtree)
4. Хелперы (helpers)
    - [Text](#hel_text)
5. Ресурсы (assets)
    - [ViewTreeAsset](#ass_viewtreeasset)
    - [ViewTreeSelectAsset](#ass_viewtreeselectasset)
    - [FormAsset](#ass_formasset)

---

Поведения (behaviors)
---------------------

[](#поведения-behaviors)

### Sid

[](#sid-)

Перед валидацией экземпляра класса генерирует строковый идентификатор из указанного атрибута, тем самым давая возможность в модели указывать строковый идентификатор как необязательное поле при определенных сценариях.

**Использование**

```
use \Zlatov\yiiComponents\behaviors\Sid;

...

    public function behaviors()
    {
        return [

            ...

            'sid' => [
                'class' => Sid::className(),
                'in_attribute' => 'header',
            ],

            ...

        ];
    }

    ...

    public function rules()
    {
        return Sid::calcRules(parent::rules());
    }
```

Примеси (traits)
----------------

[](#примеси-traits)

### Sid

[](#sid--1)

### Tree

[](#tree-)

Предоставляет модели методы получающие данные из базы и преобразующие их для удобного вывода в виде дерева.

#### Использование

[](#использование)

**Модель**

```
class ...
{
    use \Zlatov\yiiComponents\traits\Tree;

    private static $treeOptions = [
        'fnId' => 'id',
        'fnPid' => 'pid',
        'fnChildrens' => 'childrens',
        'fnHeader' => 'header',
        'fnLevel' => 'level',
        'idOfTheRoot' => null,
        'addRoot' => false,
        'returnOnly' => null,
        'clearFromNonRoot' => true,
        'rootName' => 'Нет родителя (этот элемент корневой)',
        'forSelect' => false,
        'order' => [
            'level' => SORT_ASC,
            'order' => SORT_ASC,
        ],
    ];

```

**Контроллер**

```
    public function actionIndex()
    {
        $sections = Section::treeMulti();

        return $this->render('index', [
            'sections' => $sections,
        ]);
    }

```

**Представление**

```

```

Виджеты (widgets)
-----------------

[](#виджеты-widgets)

### ViewTree

[](#viewtree-)

Хелперы (helpers)
-----------------

[](#хелперы-helpers)

### Text

[](#text-)

Ресурсы (assets)
----------------

[](#ресурсы-assets)

### ViewTreeAsset

[](#viewtreeasset-)

```

```

### ViewTreeSelectAsset

[](#viewtreeselectasset-)

### FormAsset

[](#formasset-)

Использование

```
Zlatov\yiiComponents\assets\FormAsset::register($this);

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

3308d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/zlatov-yii-components/health.svg)

```
[![Health](https://phpackages.com/badges/zlatov-yii-components/health.svg)](https://phpackages.com/packages/zlatov-yii-components)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[yiisoft/yii2-app-advanced

Yii 2 Advanced Project Template

1.7k960.6k5](/packages/yiisoft-yii2-app-advanced)[yiisoft/yii2-redis

Redis Cache, Session and ActiveRecord for the Yii framework

44912.1M264](/packages/yiisoft-yii2-redis)[yiisoft/yii2-httpclient

HTTP client extension for the Yii framework

43011.4M323](/packages/yiisoft-yii2-httpclient)[yiisoft/yii2-debug

The debugger extension for the Yii framework

20324.2M616](/packages/yiisoft-yii2-debug)[yiisoft/yii2-app-basic

Yii 2 Basic Project Template

6761.8M8](/packages/yiisoft-yii2-app-basic)

PHPackages © 2026

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