PHPackages                             yii2mod/yii2-validators - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. yii2mod/yii2-validators

ActiveYii2-extension[Validation &amp; Sanitization](/categories/validation)

yii2mod/yii2-validators
=======================

Collection of useful validators for Yii Framework 2.0

1.2(9y ago)1816.9k↓70%2MITPHP

Since May 13Pushed 9y ago3 watchersCompare

[ Source](https://github.com/yii2mod/yii2-validators)[ Packagist](https://packagist.org/packages/yii2mod/yii2-validators)[ RSS](/packages/yii2mod-yii2-validators/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Yii2 validators
===============

[](#yii2-validators)

Collection of useful validators for Yii Framework 2.0

[![Latest Stable Version](https://camo.githubusercontent.com/6f897d75d21c07f20841e289fd92842b0c6f62343d44be58566d4e902cfec3fa/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d76616c696461746f72732f762f737461626c65)](https://packagist.org/packages/yii2mod/yii2-validators) [![Total Downloads](https://camo.githubusercontent.com/8a086efb58425299cca3c12f038e882b4986d668d4dfcc7436dfbe0326da8f45/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d76616c696461746f72732f646f776e6c6f616473)](https://packagist.org/packages/yii2mod/yii2-validators) [![License](https://camo.githubusercontent.com/f03d0b20593d413af621b93541937a203ee8862e0b6bb24dcd93cce47bd6afeb/68747470733a2f2f706f7365722e707567782e6f72672f796969326d6f642f796969322d76616c696461746f72732f6c6963656e7365)](https://packagist.org/packages/yii2mod/yii2-validators)[![Build Status](https://camo.githubusercontent.com/8450e0f314f5ff0e1d2eda36b3e4003df158021e2e29c7d403df78675ccc9922/68747470733a2f2f7472617669732d63692e6f72672f796969326d6f642f796969322d76616c696461746f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yii2mod/yii2-validators)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yii2mod/yii2-validators "*"

```

or add

```
"yii2mod/yii2-validators": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

- **Credit Card Validator**

```
    public function rules()
    {
        return [
            [['creditCard'], \yii2mod\validators\ECCValidator::className()],
        ];
    }
```

- **Yii2 phone validator is a validator uses phone number util to validate and format the phone number attribute of model.**

```
    public function rules()
    {
        return [
            [['phone'], \yii2mod\validators\PhoneValidator::className(), 'country' => 'US'], // OR
            [['phone'], \yii2mod\validators\PhoneValidator::className(), 'countryAttribute' => 'country'], // OR
            [['phone'], \yii2mod\validators\PhoneValidator::className(), 'countryCodeAttribute' => 'countryCode'],
        ];
    }
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

3510d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a53a15e1548ce60ee92591e71492a39eaaecfc88eaa1a9d7f353d5c910381de?d=identicon)[disem](/maintainers/disem)

---

Top Contributors

[![dmitry-semenov](https://avatars.githubusercontent.com/u/17027799?v=4)](https://github.com/dmitry-semenov "dmitry-semenov (6 commits)")

---

Tags

yii2yii2-card-validatoryii2-extensionyii2-phone-validatoryii2-validatorsyii2yii2-validatorsyii2 card validatoryii2 phone validator

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/yii2mod-yii2-validators/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[borales/yii2-phone-input

Yii2 International telephone numbers - Asset Bundle, Behavior, Validator, Widget

1331.7M6](/packages/borales-yii2-phone-input)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.8k58](/packages/skeeks-cms)[udokmeci/yii2-phone-validator

Modern Yii2 Phone validator wrapper on top of PhoneNumberUtil library also used by Android devices

36224.9k1](/packages/udokmeci-yii2-phone-validator)[codeonyii/yii2-at-least-validator

Validates at least one (or more) attributes.

28263.7k1](/packages/codeonyii-yii2-at-least-validator)

PHPackages © 2026

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