inteve / forms
Predefined controls for Nette\Forms
Fund package maintenance!
Other
Installs: 8 592
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.0
- nette/forms: ^3.0
- nette/utils: ^3.0 || ^4.0
Requires (Dev)
- inteve/types: ^2.0
- nette/application: ^3.0
- nette/tester: ^2.0
Suggests
- inteve/types: For UrlSlugInput and UrlPathInput
- nette/application: For Inteve\Forms\IFormFactory.
README
Controls for Nette\Forms.
Installation
Download a latest package or use Composer:
composer require inteve/forms
Library requires PHP 7.2 or later.
DateInput
$form['date'] = new Inteve\Forms\DateInput('Date:', 'Error message for invalid date.'); $form['date']->setDefaultValue(new \DateTimeImmutable('2018-01-01 20:18')); $form['date']->setDefaultValue(new \DateTime('2018-01-01 20:18')); $form['date']->getValue(); // DateTimeImmutable|NULL
DateTimeInput
$form['datetime'] = new Inteve\Forms\DateTimeInput('Datetime:', 'Error message for invalid datetime.'); $form['datetime']->setDefaultValue(new \DateTimeImmutable('2018-01-01 20:18')); $form['datetime']->setDefaultValue(new \DateTime('2018-01-01 20:18')); $form['datetime']->getValue(); // DateTimeImmutable|NULL
You can set timezone for HTML value.
$form['datetime'] = new Inteve\Forms\DateTimeInput('Datetime:', $errorMessage, 'Europe/Prague');
TimeInput
$form['time'] = new Inteve\Forms\TimeInput('Time:', 'Error message for invalid time.'); $form['time']->setDefaultValue(new \DateTimeImmutable('2018-01-01 20:18')); $form['time']->setDefaultValue(new \DateTime('2018-01-01 20:18')); $form['time']->setDefaultValue(new \DateInterval('PT20H18M')); $form['time']->getValue(); // DateInterval|NULL
Others
- HtmlInput
- UrlPathInput
- UrlSlugInput
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/