PHPackages                             mgilangjanuar/yii2-spfjs - 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. mgilangjanuar/yii2-spfjs

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

mgilangjanuar/yii2-spfjs
========================

yii2 plugin with spfjs for fast navigation and page updates

0.1.8(9y ago)021MITJavaScript

Since Feb 16Pushed 9y agoCompare

[ Source](https://github.com/mgilangjanuar/yii2-spfjs)[ Packagist](https://packagist.org/packages/mgilangjanuar/yii2-spfjs)[ RSS](/packages/mgilangjanuar-yii2-spfjs/feed)WikiDiscussions master Synced 4w ago

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

yii2-spfjs
==========

[](#yii2-spfjs)

This is an extension for yii2 with *spfjs* ([github.com/youtube/spfjs](https://github.com/youtube/spfjs)) for fast navigation and with *pace* ([github.com/HubSpot/pace](https://github.com/HubSpot/pace)) for web page progress bar.

Get Started
-----------

[](#get-started)

### Setup AppAsset

[](#setup-appasset)

Add this in depends attribute in your `AppAsset` class

```
public $depends = [
    // other depends bundle here
    'mgilangjanuar\yii2spf\SpfAssetBundle',
];

```

### Setup Controller

[](#setup-controller)

In all controllers you want, implement method `behaviors()` and add this

```
public function behaviors()
{
    return [
        // add yii2spf behavior
        'spfjs' => [
            'class' => \mgilangjanuar\yii2spf\ControllerBehavior::className(),

            // default attributes value
            'title' => [
                'contentBetween' => ['', '']
            ],
            'styles' => [
                'contentBetween' => ['', '']
            ],
            'body' => [
                // get from id #main-content content
                'main-content' => ['contentBetween' => ['', '']]

                // you can add others elements in body here
                // ...
            ],
            'scripts' => [
                'contentBetween' => ['', '']
            ],
        ],

        // others behaviors here...
    ];
}

```

### Setup Main Layout

[](#setup-main-layout)

After register `AppAsset` in your main layout, add this for *pace* widget

```
\mgilangjanuar\yii2spf\PaceWidget::widget([
    'color'=>'red',
    'theme'=>'minimal',
    'options'=>[
        'ajax'=>['trackMethods'=>['GET','POST','AJAX']]
    ]
]);

```

Find `` in main layout and add this comments line between that code

```

```

Find `` and add this comments line between that

```

```

And finnaly, add this comments line between your dynamic content and add div tag with id `main-content`(or as you defined in behavior method in your class).

```

```

License
-------

[](#license)

yii2-spfjs is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)for details.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

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

Every ~0 days

Total

7

Last Release

3421d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3146378?v=4)[M Gilang Januar](/maintainers/mgilangjanuar)[@mgilangjanuar](https://github.com/mgilangjanuar)

---

Top Contributors

[![mgilangjanuar](https://avatars.githubusercontent.com/u/3146378?v=4)](https://github.com/mgilangjanuar "mgilangjanuar (22 commits)")

### Embed Badge

![Health badge](/badges/mgilangjanuar-yii2-spfjs/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

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

PHPackages © 2026

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