Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inteve/forms
Controls for Nette\Forms
https://github.com/inteve/forms
forms nette nette-forms php
Last synced: about 2 months ago
JSON representation
Controls for Nette\Forms
- Host: GitHub
- URL: https://github.com/inteve/forms
- Owner: inteve
- License: other
- Created: 2016-05-16T05:09:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T06:55:18.000Z (over 1 year ago)
- Last Synced: 2024-11-13T14:42:32.594Z (about 2 months ago)
- Topics: forms, nette, nette-forms, php
- Language: PHP
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license.md
Awesome Lists containing this project
README
Inteve\Forms
============[![Build Status](https://github.com/inteve/forms/workflows/Build/badge.svg)](https://github.com/inteve/forms/actions)
[![Downloads this Month](https://img.shields.io/packagist/dm/inteve/forms.svg)](https://packagist.org/packages/inteve/forms)
[![Latest Stable Version](https://poser.pugx.org/inteve/forms/v/stable)](https://github.com/inteve/forms/releases)
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/inteve/forms/blob/master/license.md)Controls for Nette\Forms.
Installation
------------[Download a latest package](https://github.com/inteve/forms/releases) or use [Composer](http://getcomposer.org/):
```
composer require inteve/forms
```Library requires PHP 7.2 or later.
DateInput
---------```php
$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
-------------```php
$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.
```php
$form['datetime'] = new Inteve\Forms\DateTimeInput('Datetime:', $errorMessage, 'Europe/Prague');
```TimeInput
---------```php
$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](license.md)
Author: Jan Pecha, https://www.janpecha.cz/