azathoth/forms-phone

Small modification of Nella Phone control for Nette Forms.

v1.0.5 2015-04-14 11:11 UTC

README

Build Status Latest Stable Version Composer Downloads Dependency Status

Installation

composer require nella/forms-phone

Usage

$form = new \Nette\Forms\Form;
$form->addComponent(new \Nella\Forms\Controls\PhoneNumberInput('Phone'), 'phone');

// or

\Nella\Forms\Controls\PhoneNumberInput::register();
$form->addPhone('phone', 'Phone');

// Optional phone numnber validation
$form['phone']
	->addCondition(\Nette\Application\UI\Form::FILLED)
		->addRule([$form['phone'], 'validatePhoneNumber'], 'Phone number is invalid');

Manual rendering

{form myForm}
	{label phone /}
	{input phone:prefix}
	{input phone:number}
{/form}

License

Phone number control for Nette Framework is licensed under the MIT License - see the LICENSE file for details