PHPackages                             zacksleo/yii2-recently-viewed-behavior - 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. zacksleo/yii2-recently-viewed-behavior

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

zacksleo/yii2-recently-viewed-behavior
======================================

yii2 recently viewed behavior

1.0.0(8y ago)03921MITPHPCI failing

Since Aug 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zacksleo/yii2-recently-viewed-behavior)[ Packagist](https://packagist.org/packages/zacksleo/yii2-recently-viewed-behavior)[ RSS](/packages/zacksleo-yii2-recently-viewed-behavior/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

yii2-recently-viewed-behavior
=============================

[](#yii2-recently-viewed-behavior)

[![StyleCI](https://camo.githubusercontent.com/e0c0c74949d3f5b2307fedbdbdfaaeb6d639d0b5f8d592b801b29ee2ebca2458/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130313532373634332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/101527643)[![Build Status](https://camo.githubusercontent.com/7743e0bcbf905e82129be89e47a4ec1edd0c3d95fc2512c1c89e085bcc86e37d/68747470733a2f2f7472617669732d63692e6f72672f7a61636b736c656f2f796969322d726563656e746c792d7669657765642d6265686176696f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/zacksleo/yii2-recently-viewed-behavior)![Code Climate](https://camo.githubusercontent.com/eb1231daa5b686b0ccda53e2d7e3884da4e13e33225c31071bca213820e30be0/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f7a61636b736c656f2f796969322d726563656e746c792d7669657765642d6265686176696f722e737667)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6a81e99744f839fe48b99ab40eebaafc7df1dd718288a93577bfccca73775a8e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a61636b736c656f2f796969322d726563656e746c792d7669657765642d6265686176696f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zacksleo/yii2-recently-viewed-behavior/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e9082721a5a95771bb2089d9977097947cef4e2362ca812667db5a025156e216/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a61636b736c656f2f796969322d726563656e746c792d7669657765642d6265686176696f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zacksleo/yii2-recently-viewed-behavior/?branch=master)

Quick Start
-----------

[](#quick-start)

### Install

[](#install)

```
  composer install zacksleo/yii2-recently-viewed-behavior
```

### Usage

[](#usage)

```
use yii\web\Controller;
use zacksleo\yii2\behaviors\RecentlyViewedBehavior;

class DefaultController extends Controller
{

    public function behaviors()
    {
        return [
            'recentlyViewed' => [
                'class' => RecentlyViewedBehavior::className(),
                'limit' => 5, // Limit the number of recently viewed items stored. 0 = no limit.
            ],
        ];
    }

    public function actionView($id)
    {
        // set recently models
        $model = $this->findModel($id);
        $this->setRecentlyViewed(get_class($model), $id);
        // get recently models
        $this->getRecentlyViewed(get_class($model));
    }
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

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

3229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e97b8a6f67b09513e345a128d73a63898ae1ec9f6a6c77234c78b3f16d305d1?d=identicon)[zacksleo](/maintainers/zacksleo)

---

Top Contributors

[![zacksleo](https://avatars.githubusercontent.com/u/3369169?v=4)](https://github.com/zacksleo "zacksleo (21 commits)")

---

Tags

yii2yii2-behaviorsyii2-extension

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zacksleo-yii2-recently-viewed-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/zacksleo-yii2-recently-viewed-behavior/health.svg)](https://phpackages.com/packages/zacksleo-yii2-recently-viewed-behavior)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)

PHPackages © 2026

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