PHPackages                             diiimonn/yii2-behavior-relation-follow - 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. diiimonn/yii2-behavior-relation-follow

ActiveYii2-extension

diiimonn/yii2-behavior-relation-follow
======================================

v1.0.0(11y ago)1801PHP

Since Feb 23Pushed 11y ago2 watchersCompare

[ Source](https://github.com/diiimonn/yii2-behavior-relation-follow)[ Packagist](https://packagist.org/packages/diiimonn/yii2-behavior-relation-follow)[ Docs](https://github.com/diiimonn/yii2-behavior-relation-follow)[ RSS](/packages/diiimonn-yii2-behavior-relation-follow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

yii2-behavior-relation-follow
=============================

[](#yii2-behavior-relation-follow)

Model behavior for relation data management

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

[](#installation)

To install with composer:

```
$ php composer.phar require diiimonn/yii2-behavior-relation-follow "dev-master"

```

or add

```
"diiimonn/yii2-behavior-relation-follow": "dev-master"

```

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

Usage
-----

[](#usage)

### in MyModel.php

[](#in-mymodelphp)

```
...
use diiimonn\behaviors\RelationFollowBehavior;
...

public function behaviors()
{
    return [
        ...
        [
            'class' => RelationFollowBehavior::className(),
            'relations' => [
                'books', // relation name
            ]
        ],
    ];
}

public function getBooks()
{
    return $this->hasMany(BookModel::className(), ['id' => 'book_id'])->via('authorBooks');
}

public function getAuthorBooks()
{
    return $this->hasMany(AuthorBooks::className(), ['author_id' => 'id']);
}
...
```

### in my-view/\_form.php

[](#in-my-view_formphp)

Select multiple from relation model. Recommended use [yii2-widget-checkbox-multiple](https://github.com/diiimonn/yii2-widget-checkbox-multiple)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

4097d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d6283ded189bfbc5efc744b457ba790319aea62b0d64121ab13ba4ee7310eca?d=identicon)[diiimonn](/maintainers/diiimonn)

---

Top Contributors

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

---

Tags

yii2extensionBehaviorrelation

### Embed Badge

![Health badge](/badges/diiimonn-yii2-behavior-relation-follow/health.svg)

```
[![Health](https://phpackages.com/badges/diiimonn-yii2-behavior-relation-follow/health.svg)](https://phpackages.com/packages/diiimonn-yii2-behavior-relation-follow)
```

###  Alternatives

[lav45/yii2-translated-behavior

This extension allows you to quickly and simple enough to add translations for any ActiveRecord models.

3742.2k](/packages/lav45-yii2-translated-behavior)[arogachev/yii2-many-to-many

Many-to-many ActiveRecord relation for Yii 2 framework

3541.2k4](/packages/arogachev-yii2-many-to-many)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)[valentinek/yii2-closure-table-behavior

This extension allows you to get functional for closure table trees.

1615.3k](/packages/valentinek-yii2-closure-table-behavior)[v0lume/yii2-meta-tags

DB based model meta data for SEO

204.1k](/packages/v0lume-yii2-meta-tags)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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