ruwork/polyfill-form-dti
Composer 安装命令:
composer require ruwork/polyfill-form-dti
包简介
Symfony Form polyfill adding input=datetime_immutable to date types.
README 文档
README
This package is a polyfill for my pull request adding input=datetime_immutable option to the Symfony date and time form types.
Works with PHP >=5.5 and Symfony >=2.8.
If you use Symfony Framework have a look at the corresponding ruwork/polyfill-form-dti-bundle.
Installation
composer require ruwork/polyfill-form-dti
Usage
<?php use Ruwork\PolyfillFormDTI\DTIExtension; use Ruwork\PolyfillFormDTI\Guesser\DoctrineOrmDTIGuesser; use Symfony\Component\Form\Extension\Core\Type\DateTimeType; use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\Extension\Core\Type\TimeType; use Symfony\Component\Form\Forms; /** @var \Doctrine\Common\Persistence\ManagerRegistry $registry */ $factory = Forms::createFormFactoryBuilder() ->addExtension(new DTIExtension()) // Optionally you can add a Doctrine ORM guesser // to guess input=datetime_immutable for Doctrine 2.6 immutable date types. ->addTypeGuesser(new DoctrineOrmDTIGuesser($registry)) ->getFormFactory(); $form = $factory ->createBuilder(FormType::class, [ 'datetime' => new \DateTimeImmutable('1828-09-09 12:00:00'), 'date' => new \DateTimeImmutable('1860-01-29'), 'time' => new \DateTimeImmutable('23:59'), ]) ->add('datetime', DateTimeType::class, [ 'input' => 'datetime_immutable', ]) ->add('date', DateType::class, [ 'input' => 'datetime_immutable', ]) ->add('time', TimeType::class, [ 'input' => 'datetime_immutable', ]) ->getForm();
Testing
vendor/bin/simple-phpunit
ruwork/polyfill-form-dti 适用场景与选型建议
ruwork/polyfill-form-dti 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52.25k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「form」 「polyfill」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ruwork/polyfill-form-dti 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ruwork/polyfill-form-dti 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ruwork/polyfill-form-dti 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A polyfill for pthreads
The bundle for easy using json-rpc api on your project
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
Compatibility layer for emulating enumerations in PHP < 8.1 and native enumerations in PHP >= 8.1
PHP polyfill for the Apache Functions. The aim is to provides functions as the PHP way in order to get them available even if PHP is not running as an Apache module.
Polyfill for mb_ereg(), mb_eregi(), mb_ereg_match(), and mb_ereg_replace*() functions; primary use case is for mbstring on Windows 7.4+
统计信息
- 总下载量: 52.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-11