PHPackages                             jakharbek/yii2-tags - 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. jakharbek/yii2-tags

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

jakharbek/yii2-tags
===================

Tags

1177PHP

Since Feb 28Pushed 8y agoCompare

[ Source](https://github.com/jakharbek/yii2-tags)[ Packagist](https://packagist.org/packages/jakharbek/yii2-tags)[ RSS](/packages/jakharbek-yii2-tags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Tags
====

[](#tags)

Tags

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist jakharbek/yii2-tags "*"

```

or add

```
"jakharbek/yii2-tags": "*"

```

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

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

You need to connect i18n for translations

```
 'jakhar-tags' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@vendor/jakharbek/yii2-tags/src/messages',
                    'sourceLanguage' => 'en',
                    'fileMap' => [
                        'jakhar-tags'       => 'main.php',
                    ],
                ],
```

and migrate the database

```
yii migrate --migrationPath=@vendor/jakharbek/yii2-tags/src/migrations
```

Update (Active Record) - Single
-------------------------------

[](#update-active-record---single)

example with Posts elements

You must connect behavior to your database model (Active Record)

```

  use jakharbek\tags\behaviors\TagsModelBehavior;

 'tag_model'=> [
                        'class' => TagsModelBehavior::className(),
                        'attribute' => 'categoriesform',
                        'separator' => ',',
                        ],
```

after

Вы должны настроить связи по примеру Постов

```
    public function getTags()
    {
        return $this->hasMany(Tags::className(), ['tag_id' => 'tag_id'])->viaTable('poststags', ['post_id' => 'post_id']);
    }
    public function getPoststags()
    {
        return $this->hasMany(Poststags::className(), ['post_id' => 'post_id']);
    }
```

потом вам нужно создать свойство для формы для обмена данных например

```
            private $_tagsform;

            ...

            public function getTagsform(){
                return $this->_tagsform;
            }
            public function setTagsform($value){
                return $this->_tagsform = $value;
            }
```

если у вас уже создана можете использовать своё

View
----

[](#view)

```
use jakharbek\tags\widgets\TagsWidget;

...

echo TagsWidget::widget([
        'model_db' => $model,
        'nameform' => 'Posts[tagsform]'
        ]);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

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://www.gravatar.com/avatar/a2721d46252bc78f08af8c419a8ac814b6b79c9764696686e13e119e4f291f95?d=identicon)[javharbek](/maintainers/javharbek)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/jakharbek-yii2-tags/health.svg)

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

###  Alternatives

[kzykhys/parallel

Simple multitasking library

93334.1k4](/packages/kzykhys-parallel)[tiny-pixel/acorn-block-templates

Block templates for Sage 10

191.2k](/packages/tiny-pixel-acorn-block-templates)

PHPackages © 2026

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