PHPackages                             mrssoft/yii2-link-relative - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrssoft/yii2-link-relative

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

mrssoft/yii2-link-relative
==========================

1.0.1(7y ago)0181MITPHP

Since May 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mrs2000/yii2-link-relative)[ Packagist](https://packagist.org/packages/mrssoft/yii2-link-relative)[ RSS](/packages/mrssoft-yii2-link-relative/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

yii2-link-relative
==================

[](#yii2-link-relative)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist mrssoft/yii2-link-relative "*"

```

or add

```
"mrssoft/yii2-link-relative": "*"

```

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

Usage
-----

[](#usage)

Виджет:

```
    echo LinkRelativeWidget::widget([
        'model' => $model, //Базовая модель
        'relationName' => 'items', //Название отношения (конечного)
        'attributeTitle' => 'title', //Атрибут для вывода в таблице
        'viaToElementName' => 'item',
        'ajaxUrl' => ['item/search'], //Ссылка на поиск элементов
        'placeholder' => 'Поиск товара...',
        'name' => 'Товар' //Название элементов в таблице
    ]);
```

Поведение базовой модели:

```
    public function behaviors()
    {
        return [
            [
                'class' => SaveRelationBehavior::class,
                'relationName' => 'items'
            ],
        ];
    }
```

Действие для поиска элементов:

```
    public function actionSearch($search = null)
    {
        $out = ['results' => ['id' => '', 'text' => '']];

        if ($search !== null) {
            $data = Item::find()
                        ->select(['CONCAT(`type`, " ", `name`) as text', 'id'])
                        ->andWhere(['like', 'name', $search])
                        ->orWhere(['like', 'type', $search])
                        ->orderBy('text')
                        ->limit(20)
                        ->asArray()
                        ->all();
            $out['results'] = array_values($data);
        }

        Yii::$app->response->format = Response::FORMAT_JSON;
        return $out;
    }
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

2807d ago

### Community

Maintainers

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

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/mrssoft-yii2-link-relative/health.svg)

```
[![Health](https://phpackages.com/badges/mrssoft-yii2-link-relative/health.svg)](https://phpackages.com/packages/mrssoft-yii2-link-relative)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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