PHPackages                             ijackua/yii2-gon - 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. ijackua/yii2-gon

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

ijackua/yii2-gon
================

Push data from PHP controller to JS variable (inspired by https://github.com/gazay/gon)

1.0.0(10y ago)86.2kMITPHPPHP &gt;=5.3.0

Since Dec 6Pushed 10y ago1 watchersCompare

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

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

yii2-gon
========

[](#yii2-gon)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4c5e9623486326f900369f7a0f73566c850e57dbdb3f3adf87785f3f49affb67/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696a61636b75612f796969322d676f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ijackua/yii2-gon)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/9bf7b193d3108bcccb7166cde74514000b44a9f6161730caee46e7e5777cae0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696a61636b75612f796969322d676f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ijackua/yii2-gon)

Push data from PHP controller to global JS variable (inspired by )

Install
-------

[](#install)

Via Composer

```
$ composer require ijackua/yii2-gon
```

Configure
---------

[](#configure)

Add component to application config

```
'components' => array(
    'gon' => 'ijackua\gon\GonComponent'
),
```

And to app `bootstrap` section

```
$config = array(
    'bootstrap' => array('gon'),
    ...
```

Full component configuration example

```
'components' => array(
       'gon' => array(
            'class' => 'ijackua\gon\GonComponent',
            'jsVariableName' => 'gon',
            'globalData' => ['g1' => 1, 'g2' => '2'],
            'showEmptyVar' => true,
        )
),
```

Usage
-----

[](#usage)

Anywhere in your app `push` key -&gt; value

```
\Yii::$app->gon->push('someObj', ['a'=>'b']);
\Yii::$app->gon->push('str', 'hello');
```

On JS side you will get

```
> window.gon
>> Object
      someObj: Object
         {
           a: "b"
         }
      str: "hello"
```

TODO
----

[](#todo)

- Make optional non-global usage. AMD, CommonJS modules.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Ievgen Kuzminov](https://github.com/iJackUA)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

3816d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/568566?v=4)[Yevhen Kuzminov](/maintainers/iJackUA)[@iJackUA](https://github.com/iJackUA)

---

Top Contributors

[![iJackUA](https://avatars.githubusercontent.com/u/568566?v=4)](https://github.com/iJackUA "iJackUA (11 commits)")

---

Tags

javascriptextensionyii

### Embed Badge

![Health badge](/badges/ijackua-yii2-gon/health.svg)

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

###  Alternatives

[evgeniyrru/yii2-slick

Yii2 extension for Slick Carousel

22182.1k3](/packages/evgeniyrru-yii2-slick)[romka-chev/yii2-swiper

Yii2 extension for Swiper slider

1840.6k](/packages/romka-chev-yii2-swiper)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

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

PHPackages © 2026

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