alnurarif/ansformbuilder
Composer 安装命令:
composer require alnurarif/ansformbuilder
包简介
This package will help to create inputs of form
README 文档
README
AnsFormBuilder was created by and is maintained by Mohammad Al-Nur Sarwer Arif. It was created to create form's input easily.
Installation
To get the latest version you need only require the package via Composer.
Composer require alnurarif/AnsFormBuilder
Manually add the package the following providers should be added in your config/app.php:
Alnurarif\Ansformbuilder\AnsFormBuilderServiceProvider::class
Usage
use Illuminate\Support\Facades\Route;
use Alnurarif\Ansformbuilder\Ansformbuilder;
Route::get('/test', function () {
//Instantiage the inputs object
$name = new Ansformbuilder;
$password = new Ansformbuilder;
$students = new Ansformbuilder;
$departments = new Ansformbuilder;
$skills = new Ansformbuilder;
//Set the data for input tag and get and data array
$nameData = $name->createInput()
->setInputType('text')
->setName('name')
->setClasses(['destined', 'parked', 'hallow'])
->setID('name')
->setRequired(true)
->setInputValue('Test Name')
->getData();
//Set the data for input tag which is password type and get the data array
$passwordData = $password->createInput()
->setInputType('password')
->setName('password')
->setClasses(['destined', 'parked', 'hallow'])
->setID('password')
->setRequired(true)
->setInputValue('Test Name')
->getData();
//Set the data for select tag data and get the data array
$studentsData = $students->createSelect()
->setName('students')
->setClass('maki')
->setID('ulah')
->setValues([1=>'ahmed', 2=>'rakib', 3=>'sultan'])
->setActiveValue(1)
->setRequired(true)
->getData();
//Set the data for radio data and get the data array
$departmentsData = $departments->createRadio()
->setName('students')
->setClass('maki')
->setID('ulah')
->setValues([1=>'science', 2=>'commerce', 3=>'arts'])
->setActiveValue(2)
->setRequired(true)
->getData();
//Set the data for checkbox data and get the data array
$skillsData = $skills->createCheckbox()
->setName('skills')
->setClass('maki')
->setID('ulah')
->setValues([1=>'php', 2=>'javascript', 3=>'mysql'])
->setActiveValue(3)
->setRequired(false)
->getData();
//pass the data array to views where it could be used to generate input
return view('greeting', [
'input1' => $nameData,
'input2' => $passwordData,
'input3' => $studentsData,
'input4' => $departmentsData,
'input5' => $skillsData
]);
});
// only single class can be added using setClass method and setClasses for multiple class
// for input tag setInputValue will be used and for others setValues where and array will be passed
}
alnurarif/ansformbuilder 适用场景与选型建议
alnurarif/ansformbuilder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 09 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alnurarif/ansformbuilder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alnurarif/ansformbuilder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-07