承接 fsevestre/boolean-form-type 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fsevestre/boolean-form-type

最新稳定版本:v2.1.0

Composer 安装命令:

composer require fsevestre/boolean-form-type

包简介

Boolean form type for Symfony REST APIs

README 文档

README

Boolean form type for Symfony REST APIs.

Installation

The recommended way to install this library is through Composer.

Require the fsevestre/boolean-form-type package by running the following command:

$ composer require fsevestre/boolean-form-type

This will resolve the latest stable version and install all the dependencies.

Otherwise, install the library and setup the autoloader yourself.

Usage

$builder->add('enabled', BooleanType::class);

By default, the form type use a data transformer which will transform the value to true (1, '1', true and 'true') or false (0, '0', false and 'false').

If you want to support more values, you can override the true_values and false_values form type options:

$builder
    ->add('enabled', BooleanType::class,
        array(
            'true_values' => array(1, '1', true, 'true', 'on', 'yes'),
            'false_values' => array(0, '0', false, 'false', 'off', 'no'),
        )
    )
;

Note: The form type is not intended to be displayed on a browser: use the built-in CheckboxType form type provided by Symfony instead.

Tests

To setup and run tests follow these steps:

$ composer install
$ bin/phpunit

Contributing

See CONTRIBUTING file.

License

This library is distributed under the MIT license.

统计信息

  • 总下载量: 450.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固