PHPackages                             pozitronik/yii2-cachedwidget - 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. [Caching](/categories/caching)
4. /
5. pozitronik/yii2-cachedwidget

ActiveYii2-extension[Caching](/categories/caching)

pozitronik/yii2-cachedwidget
============================

Caching support for Yii2 widgets

1.1.0(5y ago)03.5k1GPL-3.0-or-laterPHP

Since Feb 28Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (12)Used By (1)

CachedWidget
============

[](#cachedwidget)

Caching support for Yii2 widgets

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

[](#installation)

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

Run

```
php composer.phar require pozitronik/yii2-cachedwidget "dev-master"

```

or add

```
"pozitronik/yii2-cachedwidget": "dev-master"

```

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

Requirements
------------

[](#requirements)

Yii2, PHP &gt;= 7.2.0

Usage
-----

[](#usage)

Once the extension is installed, simply inherit any widgets from `pozitronik\widgets\CachedWidget` class instead of `yii\base\Widget` in your code.

CachedWidget has redefined `render()` method, that stores all rendered views in Yii2 global cache (with nested widgets, if its called in view file).

Widget handles correctly Yii2 view assets and inline resources, like js/css files or inline code inclusion.

Caching is **disabled** by default within YII\_ENV\_DEV environment (see $disable property).

Example
-------

[](#example)

```
 class MyWidget extends \pozitronik\widgets\CachedWidget {
 // it is all, mostly
 }
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

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

Every ~23 days

Total

10

Last Release

2059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76ddc43524bb32eb36568e25b6ae283bc25bb51a4572789997909092145af0f5?d=identicon)[pozitronik](/maintainers/pozitronik)

---

Top Contributors

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

---

Tags

cachingwidgetsyii2cacheyii2extensionwidget

### Embed Badge

![Health badge](/badges/pozitronik-yii2-cachedwidget/health.svg)

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

###  Alternatives

[undefinedor/yii2-cached-active-record

The cached activeRecord for the Yii2 framework

102.6k](/packages/undefinedor-yii2-cached-active-record)

PHPackages © 2026

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