PHPackages                             crisu83/yii-extension - 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. crisu83/yii-extension

ActiveYii-extension

crisu83/yii-extension
=====================

Tools for building extensions for the Yii PHP framework.

1.2.0(12y ago)33.0k4BSD-3-ClausePHP

Since Jul 5Pushed 12y agoCompare

[ Source](https://github.com/Crisu83/yii-extension)[ Packagist](https://packagist.org/packages/crisu83/yii-extension)[ RSS](/packages/crisu83-yii-extension/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (7)Used By (4)

yii-extension
=============

[](#yii-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/48bab83cdcf725ce9ff002b91d7bc145ecefe6135eb43c6aafd65b099bdf0c84/68747470733a2f2f706f7365722e707567782e6f72672f637269737538332f7969692d657874656e73696f6e2f762f737461626c652e706e67)](https://packagist.org/packages/crisu83/yii-extension)

A convenient way to start building your own extensions for the Yii PHP framework.

This project was created to minimize boilerplate code required when creating new extensions for Yii. It includes separate behaviors for Widgets, Components and Modules that all extend the ExtensionBehavior class.

Usage
-----

[](#usage)

### Widgets

[](#widgets)

#### Attaching the behavior

[](#attaching-the-behavior)

```
Yii::import('vendor.crisu83.yii-extension.behaviors.*');

MyWidget extends CWidget
{
  public function init()
  {
    parent::init();
    $this->attachBehavior('ext', new WidgetBehavior);
  }
}
```

#### Registering assets

[](#registering-assets)

```
$this->publishAssets(__DIR__ . '/path/to/assets');
$this->registerCssFile('css/styles.css');
$this->registerScriptFile('js/script.js');
```

### Components

[](#components)

#### Attaching the behavior

[](#attaching-the-behavior-1)

```
Yii::import('vendor.crisu83.yii-extension.behaviors.*');

MyApplicationComponent extends CApplicationComponent
{
  public function init()
  {
    parent::init();
    $this->attachBehavior('ext', new ComponentBehavior);
  }
}
```

#### Importing classes and directories

[](#importing-classes-and-directories)

```
$this->createPathAlias('myExtension', __DIR__);
$this->import('MyClass');
$myClass = new MyClass;
```

#### Registering assets

[](#registering-assets-1)

```
$this->publishAssets(__DIR__ . '/path/to/assets');
$this->registerCssFile('css/styles.css');
$this->registerScriptFile('js/script.js');
```

### Modules

[](#modules)

#### Attaching the behavior

[](#attaching-the-behavior-2)

```
Yii::import('vendor.crisu83.yii-extension.behaviors.*');

MyModule extends CWebModule
{
  public function init()
  {
    parent::init();
    $this->attachBehavior('ext', new ModuleBehavior);
  }
}
```

#### Importing classes and directories

[](#importing-classes-and-directories-1)

```
$this->import('MyClass');
$myClass = new MyClass;
```

#### Registering assets

[](#registering-assets-2)

```
$this->publishAssets(__DIR__ . '/path/to/assets');
$this->registerCssFile('css/styles.css');
$this->registerScriptFile('js/script.js');
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

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

Total

4

Last Release

4473d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab3becb3323ceb956c661f3e6ef4312dcd00ec4ba03d1bba5fcef793f5c4286d?d=identicon)[crisu83](/maintainers/crisu83)

---

Top Contributors

[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (48 commits)")

### Embed Badge

![Health badge](/badges/crisu83-yii-extension/health.svg)

```
[![Health](https://phpackages.com/badges/crisu83-yii-extension/health.svg)](https://phpackages.com/packages/crisu83-yii-extension)
```

PHPackages © 2026

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