PHPackages                             2amigos/yii2-pjax-filter-behavior - 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. [Search &amp; Filtering](/categories/search)
4. /
5. 2amigos/yii2-pjax-filter-behavior

AbandonedArchivedYii2-extension[Search &amp; Filtering](/categories/search)

2amigos/yii2-pjax-filter-behavior
=================================

Yii2 filters that filters HTTP requests to ensure pjax calls.

0.1.0(12y ago)46.5k21BSD-3-ClausePHP

Since Feb 26Pushed 12y ago9 watchersCompare

[ Source](https://github.com/2amigos/yii2-pjax-filter-behavior)[ Packagist](https://packagist.org/packages/2amigos/yii2-pjax-filter-behavior)[ RSS](/packages/2amigos-yii2-pjax-filter-behavior/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (1)

PjaxFilter Behavior for Yii2
============================

[](#pjaxfilter-behavior-for-yii2)

PjaxFilter is an action filter that ensures an action has been called using pjax calls and to configure what to do in case the controller's action has been called differently.

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

[](#installation)

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

Either run

```
php composer.phar require "2amigos/yii2-pjax-filter-behavior" "*"

```

or add

```
"2amigos/yii2-pjax-filter-behavior" : "*"
```

to the require section of your application's `composer.json` file.

Usage
-----

[](#usage)

To use PjaxFilter, declare it in `behaviors()` method of your controller class. For example, the following declarations will define full pjax filter for all controller's actions but the index action.

```
public function behaviors()
{
    return [
        'verbs' => [
            'class' => \dosamigos\pjaxfilter\PjaxFilter::className(),
            'actions' => [
                '*'  => ['url' => ['index']],
            ],
            'exclude' => ['index']
        ],
    ];
}

```

The next example, sets pjax filtering for controller's delete method and if not called via pjax, it will fire an error. The rest of the actions will not be affected.

```
public function behaviors()
{
    return [
        'verbs' => [
            'class' => \dosamigos\pjaxfilter\PjaxFilter::className(),
            'actions' => [
                'error' => ['code' => 404, 'msg' => 'Not found']
            ]
        ],
    ];
}

```

> [![2amigOS!](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)

*Web development has never been so fun!*[www.2amigos.us](http://www.2amigos.us)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

4458d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Tags

filterextensionBehavioryiipjaxfilter

### Embed Badge

![Health badge](/badges/2amigos-yii2-pjax-filter-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/2amigos-yii2-pjax-filter-behavior/health.svg)](https://phpackages.com/packages/2amigos-yii2-pjax-filter-behavior)
```

###  Alternatives

[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3030.6k](/packages/sjaakp-yii2-taggable)[thrieu/yii2-grid-view-state

Save filters from GridView to session, keep the filter state between pages.

1313.1k1](/packages/thrieu-yii2-grid-view-state)[nanson/yii2-postgis

Yii2-extension to work with postgis data

1851.6k](/packages/nanson-yii2-postgis)[cyneek/yii2-routes

Routing and filtering extension system for Yii2 framework that emulates the Laravel routing system.

202.1k](/packages/cyneek-yii2-routes)[sjaakp/yii2-illustrated-behavior

ActiveRecord Behavior with associated Widget for Yii2.

423.1k](/packages/sjaakp-yii2-illustrated-behavior)

PHPackages © 2026

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