PHPackages                             mg-code/yii2-filters - 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. mg-code/yii2-filters

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

mg-code/yii2-filters
====================

A collection of useful filters for Yii framework 2.0

v1.0.1(10y ago)15.1kBSD 3-ClausePHP

Since Jun 2Pushed 10y ago1 watchersCompare

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

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

AjaxFilter
==========

[](#ajaxfilter)

This filter throws an exception (BadRequestHttpException) if the applied action is receiving a non-AJAX request.

Usage
-----

[](#usage)

To use AjaxFilter, declare it in the `behaviors()` method of your controller class.

Use `only` and `except` properties to include/exclude actions from filter.

```
public function behaviors()
{
  return [
      'onlyAjax' => [
          'class' => \mgcode\filters\AjaxFilter::className(),
          'only' => ['ajaxValidate'],
      ],
  ];
}
```

DisableCsrfValidationFilter
===========================

[](#disablecsrfvalidationfilter)

This filter disables csrf validation. Mostly used for feedback actions (e.g. when receiving response from payment service).

Usage
-----

[](#usage-1)

To use DisableCsrfValidationFilter, declare it in the `behaviors()` method of your controller class.

Use `only` and `except` properties to include/exclude actions from filter.

```
public function behaviors()
{
    return [
        'disableCsrf' => [
            'class' => \mgcode\filters\DisableCsrfValidationFilter::className(),
            'only' => ['feedback'],
        ],
    ];
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3966d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1376496?v=4)[Māris Graudiņš](/maintainers/mg-code)[@mg-code](https://github.com/mg-code)

---

Top Contributors

[![mg-code](https://avatars.githubusercontent.com/u/1376496?v=4)](https://github.com/mg-code "mg-code (9 commits)")

---

Tags

filteryii2extensionajaxBehavior

### Embed Badge

![Health badge](/badges/mg-code-yii2-filters/health.svg)

```
[![Health](https://phpackages.com/badges/mg-code-yii2-filters/health.svg)](https://phpackages.com/packages/mg-code-yii2-filters)
```

###  Alternatives

[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)[keygenqt/yii2-autocomplete-ajax

A simple way to search model id of the attributes model

1015.8k](/packages/keygenqt-yii2-autocomplete-ajax)[cyneek/yii2-routes

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

202.1k](/packages/cyneek-yii2-routes)[borales/yii2-elasticsearch-behavior

Yii2 behavior to support Elasticsearch indexing

2110.2k](/packages/borales-yii2-elasticsearch-behavior)[vxm/yii2-searchable

Simple full-text search for Yii2 active record

181.4k](/packages/vxm-yii2-searchable)

PHPackages © 2026

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