azathoth / forms-phone
Small modification of Nella Phone control for Nette Forms.
v1.0.5
2015-04-14 11:11 UTC
Requires
- php: >=5.3.1
- nette/forms: ~2.3,<2.4.0
Requires (Dev)
- jakub-onderka/php-console-highlighter: ~0.3.1
- jakub-onderka/php-parallel-lint: ~0.8.0
- nette/tester: ~1.3.0
Suggests
- latte/latte: For manual rendering support
README
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