ludovicm67/php-formbuilder
Composer 安装命令:
composer require ludovicm67/php-formbuilder
包简介
A PHP class that helps you building forms
README 文档
README
How to install it
You can install this package quickly with composer: composer require ludovicm67/php-formbuilder
How to use it?
Just see these examples:
<?php include('src/ludovicm67/FormBuilder.php'); use ludovicm67\FormBuilder; /*Display a basic input with type text*/ //Result: <input type="text"> echo FormBuilder::input(); /* Display a basic input with a name attribute */ // Result: <input type="text" name="myName"> echo FormBuilder::input("text", "myName1"); /* Display a basic input with other custom attributes */ // Result: <input type="text" name="myName" id="myId" class="myClass" placeholder="Fill this beautiful field !"> echo FormBuilder::input("text", "myName2", $attrs = [ "id" => "myId", "class" => "myClass", "placeholder" => "Fill this beautiful field !" ]); /* Display a input[type=hidden] */ echo FormBuilder::hidden("myName3", "myValue"); /* Don't want to specify always the type as the first argument? The following is for you : */ // Display a input of type text : echo FormBuilder::text("myName4"); // Display a input of type password : echo FormBuilder::password("myName5"); // Display a input of type email : echo FormBuilder::email("myName6"); /* You can also pass custom attributes */ echo FormBuilder::text("myName7", ["id" => "myId1", "class" => "myClass"]); echo FormBuilder::password("myName8", ["id" => "myId2", "class" => "myClass"]); echo FormBuilder::email("myName9", ["id" => "myId3", "class" => "myClass"]); /* Display a select field : */ // Will display a select field with 4 options, the 3rd one will be disabled echo FormBuilder::select("mySelect1", ['item1', 'item2', 'item3 --disabled', 'item4'], ["id" => "myIdSelect1", "class" => "myClass"]); // Will display a select field with 4 options with value and title, the 3rd one will be disabled echo FormBuilder::select("mySelect2", [ 'valueItem1' => 'titleItem1', 'valueItem2' => 'titleItem2', 'valueItem3' => 'titleItem3 --disabled', 'valueItem4' => 'titleItem4' ], ["id" => "myIdSelect1", "class" => "myClass"]); ?>
And some more in the example folder 😉
Register this component in Laravel
After doing a composer require command, you will just have to add register the form builder by adding 'FormBuilder' => ludovicm67\FormBuilder::class, in your aliases, in the config/app.php file.
Contribute
You find a bug? You want to add some stuff? Just open an issue!
ludovicm67/php-formbuilder 适用场景与选型建议
ludovicm67/php-formbuilder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 198 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 10 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ludovicm67/php-formbuilder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ludovicm67/php-formbuilder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 198
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-10-24