PHPackages                             kdn/yii2-domain-validator - 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. kdn/yii2-domain-validator

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

kdn/yii2-domain-validator
=========================

Domain name validator for Yii 2.

1.1.4(3y ago)11122.3k↓37.9%1[1 PRs](https://github.com/dmitry-kulikov/yii2-domain-validator/pulls)1MITPHPPHP &gt;=5.4.0

Since Jul 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dmitry-kulikov/yii2-domain-validator)[ Packagist](https://packagist.org/packages/kdn/yii2-domain-validator)[ RSS](/packages/kdn-yii2-domain-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (1)

yii2-domain-validator
=====================

[](#yii2-domain-validator)

Domain validator for Yii 2.

[![License](https://camo.githubusercontent.com/f713c1cb6e5251d61c19b6f3c5582e76e24fd41c7be655a3c71207f0be7f0f24/68747470733a2f2f706f7365722e707567782e6f72672f6b646e2f796969322d646f6d61696e2d76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/kdn/yii2-domain-validator)[![Latest Stable Version](https://camo.githubusercontent.com/509135fcc406ba9eee38be1b12b2dfee248a9758bdfcec76c11b75cb08553dba/68747470733a2f2f706f7365722e707567782e6f72672f6b646e2f796969322d646f6d61696e2d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/kdn/yii2-domain-validator)[![Code Coverage](https://camo.githubusercontent.com/0df612a455c210a5893c3a2103a477b77dfe49a5490598ac06b15c7e3e379958/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646d697472792d6b756c696b6f762f796969322d646f6d61696e2d76616c696461746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dmitry-kulikov/yii2-domain-validator/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/bac5d2234c16e64417fad23f25eae91cccb5a378ea2a2352f0f2c32902168f9e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646d697472792d6b756c696b6f762f796969322d646f6d61696e2d76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dmitry-kulikov/yii2-domain-validator/?branch=master)[![Code Climate](https://camo.githubusercontent.com/910fafd8484b5ca3184b1ce69dfb2d3bc797545147b474dae89ca8f7d4919495/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f646d697472792d6b756c696b6f762f796969322d646f6d61696e2d76616c696461746f722f6261646765732f6770612e737667)](https://codeclimate.com/github/dmitry-kulikov/yii2-domain-validator)

Requirements
------------

[](#requirements)

- PHP 5.4 or later or HHVM 3;
- Yii framework 2;
- PHP extensions:
    - `ctype` (character type checking) extension (required);
    - `mbstring` (multibyte string) extension (required);
    - `intl` (internationalization functions) extension (optional, for IDN only).

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

[](#installation)

The preferred way to install this extension is through [Composer](https://getcomposer.org).

To install, either run

```
php composer.phar require kdn/yii2-domain-validator "*"
```

or add

```
"kdn/yii2-domain-validator": "*"

```

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

Usage
-----

[](#usage)

Model class example:

```
