PHPackages                             adt/nette-forms-phone-number - 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. adt/nette-forms-phone-number

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

adt/nette-forms-phone-number
============================

v1.8.4(5mo ago)335.0k↓40%2[1 PRs](https://github.com/AppsDevTeam/nette-forms-phone-number/pulls)1MITPHP

Since Feb 5Pushed 5mo ago13 watchersCompare

[ Source](https://github.com/AppsDevTeam/nette-forms-phone-number)[ Packagist](https://packagist.org/packages/adt/nette-forms-phone-number)[ RSS](/packages/adt-nette-forms-phone-number/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (30)Used By (1)

Phone Number input for Nette Forms
==================================

[](#phone-number-input-for-nette-forms)

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

[](#installation)

Install library via composer:

```
composer require adt/nette-forms-phone-number
```

and register method extension in `bootstrap.php`:

```
\ADT\Forms\Controls\PhoneNumberInput::register();
```

This allows you to call the method `addPhoneNumber` on class `Nette\Forms\Form` or `Nette\Forms\Container`.

Usage
-----

[](#usage)

It's very simple:

```
$form->addPhoneNumber('phone', 'Phone number')
	->setCountryCodeItems(['+420' => '+420']) // otherwise lists all countries with a prompt
	->setDefaultCountryCode('+420') // otherwise set by geo IP address
	->setRequired('Fill your phone number')
	->addRule(PhoneNumberInput::VALID, 'A phone number must be valid')
	->addRule(PhoneNumberInput::TYPE, 'A phone number must be mobile', PhoneNumberType::MOBILE);

$form->onSuccess[] = function ($form) {
	$form['phone']->getValue(); // returns instance of Brick\PhoneNumber\PhoneNumber
	$form['phone']->getValue()->getCountryCode(); // returns eg. "+420"
	$form['phone']->getValue()->getNationalNumber(); // returns eg. "776123123"
};
```

And in latte:

```
{input phone}
```

or separately:

```
{input phone:countryCode} {input phone:nationalNumber}
```

To turn on autocomplete in IDE, add `@method PhoneNumberInput addPhoneNumber($name, $label = null)` to your base form.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance71

Regular maintenance activity

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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 ~82 days

Recently: every ~69 days

Total

27

Last Release

165d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ab62e3b1b51d124387f69d423b6de47d0006c75007b97f530ee87397291730e?d=identicon)[thorewi](/maintainers/thorewi)

---

Top Contributors

[![thorewi](https://avatars.githubusercontent.com/u/605858?v=4)](https://github.com/thorewi "thorewi (35 commits)")[![Walusyak](https://avatars.githubusercontent.com/u/20837611?v=4)](https://github.com/Walusyak "Walusyak (5 commits)")[![zelenomodrypes](https://avatars.githubusercontent.com/u/755065?v=4)](https://github.com/zelenomodrypes "zelenomodrypes (4 commits)")[![vpalousek98](https://avatars.githubusercontent.com/u/45952170?v=4)](https://github.com/vpalousek98 "vpalousek98 (1 commits)")

### Embed Badge

![Health badge](/badges/adt-nette-forms-phone-number/health.svg)

```
[![Health](https://phpackages.com/badges/adt-nette-forms-phone-number/health.svg)](https://phpackages.com/packages/adt-nette-forms-phone-number)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[uestla/recaptcha-control

reCAPTCHA control for Nette Framework forms

26572.0k1](/packages/uestla-recaptcha-control)

PHPackages © 2026

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