azathoth/forms-phone

Small modification of Nella Phone control for Nette Forms.


Keywords
Forms, nette, phone, control, input
License
MIT

Documentation

Phone number control for Nette Framework

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