PHPackages                             porcelanosa/yii2-related - 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. porcelanosa/yii2-related

ActiveYii2-extension[Framework](/categories/framework)

porcelanosa/yii2-related
========================

Yii2 Extenstion

020PHP

Since Dec 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/porcelanosa/yii2-related)[ Packagist](https://packagist.org/packages/porcelanosa/yii2-related)[ RSS](/packages/porcelanosa-yii2-related/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

### yii2-related

[](#yii2-related)

Yii2 extenstions - relate the similar entities [![Latest Stable Version](https://camo.githubusercontent.com/6aeedc410864d766714603e054da8756469dd987edc2d437bdbfacd42d0cc424/68747470733a2f2f706f7365722e707567782e6f72672f706f7263656c616e6f73612f796969322d72656c617465642f762f737461626c65)](https://packagist.org/packages/porcelanosa/yii2-related)[![Total Downloads](https://camo.githubusercontent.com/c01ba66925d97917fa64c3a1050461cc11f7b7715c9cf0d6321c029129944f9d/68747470733a2f2f706f7365722e707567782e6f72672f706f7263656c616e6f73612f796969322d72656c617465642f646f776e6c6f616473)](https://packagist.org/packages/porcelanosa/yii2-related)

Install
-------

[](#install)

```
composer require porcelanosa/yii2-related
```

Run migration

```
$ php yii migrate/up --migrationPath=@vendor/porcelanosa/yii2-related/migrations
```

Set Behavior
------------

[](#set-behavior)

For model set Behavior

> **model\_id\_field\_name** - field name of primary key **model\_name\_field\_name** - field name of Name model - for example, 'name' or 'title' **post\_name** - POST attribute for send data

```
public function behaviors()
{
    return [
        'relatedBehavior' => [
            'class' => RelatedBehavior::className(),
            'model_name' => $this::className(),
            'model_id_field_name' => 'id',
            'model_name_field_name' => 'name',
            'post_name' => 'related_objects',
            'whereCondition' => 'deleted!=1' // Conditions for list of related entities
        ],
    ......
    ]
}
```

Use widget
----------

[](#use-widget)

In admin view:

```
echo \porcelanosa\yii2related\RelatedWidget::widget(
    [
        'model'        => $model,
        'model_name'   => $model::className(),
        'behaviorName' => 'relatedBehavior',
        'title'        => 'Похожие модели',
        'placeholder'  => 'Выберите похожие модели ...',
    ]
);
```

Usage
-----

[](#usage)

Get related models

```

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/518981?v=4)[Alexander Shestakov](/maintainers/porcelanosa)[@porcelanosa](https://github.com/porcelanosa)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/porcelanosa-yii2-related/health.svg)

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

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M290](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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