nella / forms-phone
This package is abandoned and no longer maintained.
No replacement package was suggested.
Phone control for Nette Forms.
v1.1.0
2014-11-15 19:26 UTC
Requires
- php: >=5.3.1
- nette/forms: ~2.2,<2.3.0
Requires (Dev)
- 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\Phone\PhoneNumberInput('Phone'), 'phone'); // or \Nella\Forms\Phone\PhoneNumberInput::register(); $form->addPhone('phone', 'Phone'); // Optional phone number validation $form['phone'] ->addCondition(\Nette\Application\UI\Form::FILLED) ->addRule([$form['phone'], 'validatePhoneNumber'], 'Phone number is invalid'); // Optional phone number default prefix $control = $form->addPhone('phone', 'Phone'); $control->setDefaultPrefix('+420');
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