PHPackages                             slavcodev/yii2-yii-bridge - 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. slavcodev/yii2-yii-bridge

AbandonedArchivedYii2-extension

slavcodev/yii2-yii-bridge
=========================

Yii bridge between v1.1.x and v2.0

v0.1(11y ago)2337.1k9BSD-3-ClausePHP

Since Aug 30Pushed 6y ago11 watchersCompare

[ Source](https://github.com/yiiext/yii2-yii-bridge)[ Packagist](https://packagist.org/packages/slavcodev/yii2-yii-bridge)[ RSS](/packages/slavcodev-yii2-yii-bridge/feed)WikiDiscussions master Synced today

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

Yii bridge between v1.1.x and v2.0
==================================

[](#yii-bridge-between-v11x-and-v20)

> Warning: The extension was made for early Yii 2.0 releases and likely does not work with current version.

### Installation

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist slavcodev/yii2-yii-bridge "*"

```

or add

```
"slavcodev/yii2-yii-bridge": "*"
```

to the require section of your composer.json.

### Usage

[](#usage)

To use this bridge, edit your entry script (`index.php`)

```
// Define project directories.
$rootPath = dirname(dirname(__DIR__));

/**
 * Include composer autoloader
 * @var \Composer\Autoload\ClassLoader $loader Registered composer autoloader.
 */
$loader = require($rootPath . '/vendor/autoload.php');

// Load Yii 1 base class
define('YII1_PATH', $rootPath . '/vendor/yiisoft/yii/framework');
// Load Yii 2 base class
define('YII2_PATH', $rootPath . '/vendor/yiisoft/yii2');

// Override base class until v1.1.17 will released.
// You need version of file after this commit
// @link https://github.com/yiisoft/yii/commit/e08e47ce3ce503b5eb92f9f9bd14d36ac07e1ae9
// define('YII1_BASE_PATH', $rootPath . '/vendor/slavcodev/yii2-yii-bridge/YiiBase.php');

// Include Yii bridge class file.
require($rootPath . '/vendor/slavcodev/yii2-yii-bridge/Yii.php');

// Create old application, but NOT run it!
$gaffer = Yii::createWebApplication($v1AppConfig);

// Create new application and run. Have fun!
$application = new yii\web\Application($v2AppConfig);
$application->run();
```

Now you can use old models in your Yii2 application, i.e

```
// Access new application
echo Yii::$app->user->id;

// Access old application
echo Yii::app()->user->id;

// Use Yii2 grid, data provider with Yii1 ActiveRecords
echo yii\grid\GridView::widget([
    'dataProvider' => new \yii\data\ArrayDataProvider([
            'allModels' => User::model()->with('address.country')->findAll(),
        ]),
    'columns' => [
        ['attribute' => 'id'],
        ['attribute' => 'name'],
        ['attribute' => 'address.country.name'],
    ]
]);

// Save Yii1 AR in Yii2 controller
public function actionCreate()
{
    $user = new User();

    if ($data = Yii::app()->request->getPost(CHtml::modelName($user))) {
        $model->attributes = $data;

        if ($model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        }
    }

    return $this->render('create', [
        'model' => $user,
    ]);
}
```

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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

4222d ago

### Community

Maintainers

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

---

Top Contributors

[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (18 commits)")[![acorncom](https://avatars.githubusercontent.com/u/802505?v=4)](https://github.com/acorncom "acorncom (2 commits)")[![icevita](https://avatars.githubusercontent.com/u/3350835?v=4)](https://github.com/icevita "icevita (1 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (1 commits)")

---

Tags

yii2Yii1

### Embed Badge

![Health badge](/badges/slavcodev-yii2-yii-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/slavcodev-yii2-yii-bridge/health.svg)](https://phpackages.com/packages/slavcodev-yii2-yii-bridge)
```

###  Alternatives

[demi/php-gearman

Gearman job server workers helper

176.6k](/packages/demi-php-gearman)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1356.4k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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