PHPackages                             wdmg/yii2-views - 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. wdmg/yii2-views

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

wdmg/yii2-views
===============

System of accounting user views

1.1.0(2y ago)250531MITPHP

Since Mar 24Pushed 2y ago3 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (16)Used By (1)

[![Progress](https://camo.githubusercontent.com/8f989c4232d99c88827cc336af846359f9c7ed51b0efffd5dd20ac8bd0b1781d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72657175697265642d596969325f76322e302e33352d626c75652e737667)](https://packagist.org/packages/yiisoft/yii2)[![Github all releases](https://camo.githubusercontent.com/09d4d32903e34564a3291fbf1d869230b545b6a9890ca7151236671d6be895e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f77646d672f796969322d76696577732f746f74616c2e737667)](https://GitHub.com/wdmg/yii2-views/releases/)[![GitHub version](https://camo.githubusercontent.com/abe822193b002ee7182dba7e286bdd9ef07cd4eb312956f5cab6249f46e09469/68747470733a2f2f62616467652e667572792e696f2f67682f77646d672f796969322d76696577732e737667)](https://github.com/wdmg/yii2-views)[![Progress](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)[![GitHub license](https://camo.githubusercontent.com/ea421af37a8768e19b8fadce9fee49e90301c6555b250e9dad56aa5f135344b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77646d672f796969322d76696577732e737667)](https://github.com/wdmg/yii2-views/blob/master/LICENSE)

[![Yii2 User views](./docs/images/yii2-views.png)](./docs/images/yii2-views.png)

Yii2 User views counting
========================

[](#yii2-user-views-counting)

System of accounting user views.

This module is an integral part of the [Butterfly.СMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2023 [W.D.M.Group, Ukraine](https://wdmg.com.ua/)

Requirements
============

[](#requirements)

- PHP 5.6 or higher
- Yii2 v.2.0.35 and newest
- [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)
- [Yii2 Users](https://github.com/wdmg/yii2-users) module (optionaly)

Installation
============

[](#installation)

To install the module, run the following command in the console:

`$ composer require "wdmg/yii2-views"`

After configure db connection, run the following command in the console:

`$ php yii views/init`

And select the operation you want to perform:

1. Apply all module migrations
2. Revert all module migrations

Migrations
==========

[](#migrations)

In any case, you can execute the migration and create the initial data, run the following command in the console:

`$ php yii migrate --migrationPath=@vendor/wdmg/yii2-views/migrations`

Configure
=========

[](#configure)

To add a module to the project, add the following data in your configuration file:

```
'modules' => [
    ...
    'views' => [
        'class' => 'wdmg\views\Module',
        'routePrefix' => 'admin',
        'cacheExpire' => 3600 // hits cache lifetime, `0` - for not use cache
    ],
    ...
],

```

Usage examples
==============

[](#usage-examples)

To accountштп the number of views of an object, use the component method `Yii::$app->views-set()` module, into which you need to transfer the context and identifier. The same parameters are a condition for unique selection/filtering when receiving a view counter in the method `Yii::$app->views-get()` of component.

**Store and get the views count**

```

```

**Only get the count of views**

```

```

Routing
=======

[](#routing)

Use the `Module::dashboardNavItems()` method of the module to generate a navigation items list for NavBar, like this:

```

```

Status and version \[ready to use\]
===================================

[](#status-and-version-ready-to-use)

- v.1.1.0 - Update copyrights, fix menu dashboard
- v.1.0.1 - Update dependencies, README.md
- v.1.0.0 - Added component for set/get views counter

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

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

Recently: every ~326 days

Total

15

Last Release

1041d ago

Major Versions

0.0.12 → 1.0.02020-05-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1635637?v=4)[Alexsander Vyshnyvetskyy](/maintainers/alex-wdmg)[@alex-wdmg](https://github.com/alex-wdmg)

---

Top Contributors

[![alex-wdmg](https://avatars.githubusercontent.com/u/1635637?v=4)](https://github.com/alex-wdmg "alex-wdmg (45 commits)")

---

Tags

yii2viewswdmgyii2-views

### Embed Badge

![Health badge](/badges/wdmg-yii2-views/health.svg)

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

PHPackages © 2026

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