当前位置:网站首页>Laravel form builder uses
Laravel form builder uses
2022-07-07 13:52:00 【Full stack programmer webmaster】
add to formbuilder plug-in unit :
Composer application
composer require kris/laravel-form-builder
Download successful
Modify the configuration file
stay config/app.php
‘providers’ => [
Kris\LaravelFormBuilder\FormBuilderServiceProvider::class,
]
‘aliases’ =>[
'FormBuilder' => Kris\LaravelFormBuilder\Facades\Formbuilder::class,
]
establish form
Php artisan make:form Forms/ name –fields =“name:text,intro:text”
Generated files
public function buildForm()
{
$this ->add('name', 'text', [ 'rules' => 'required|min:5' ]) ->add('lyrics', 'textarea', [ 'rules' => 'max:5000' ]); }
Create an empty form
Php artisan make:form Forms/ name
public function buildForm()
{
}
controller
quote :
use Kris\LaravelFormBuilder\FormBuilder;
function :
public function create(FormBuilder $formBuilder){ $form = $formBuilder->create(\App\Form\PostForm::class,[ 'method' => 'POST', 'url' => route('photo.store') ]); return view('Photo.form',compact('form')); }
View :
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> {!! form($form) !!} </body> </html>
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113276.html Link to the original text :https://javaforall.cn
边栏推荐
- 记一次 .NET 某新能源系统 线程疯涨 分析
- What parameters need to be reconfigured to replace the new radar of ROS robot
- mysql 局域网内访问不到的问题
- Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
- 2022-7-6 sigurg is used to receive external data. I don't know why it can't be printed out
- QQ medicine, Tencent ticket
- Some principles of mongodb optimization
- ES日志报错赏析-Limit of total fields
- 室內ROS機器人導航調試記錄(膨脹半徑的選取經驗)
- 室内ROS机器人导航调试记录(膨胀半径的选取经验)
猜你喜欢
566. Reshaping the matrix
Custom thread pool rejection policy
AI人才培育新思路,这场直播有你关心的
flask session伪造之hctf admin
Cinnamon taskbar speed
Redis 核心数据结构 & Redis 6 新特性详
"Song of ice and fire" in the eleventh issue of "open source Roundtable" -- how to balance the natural contradiction between open source and security?
Esp32 construction engineering add components
High end for 8 years, how is Yadi now?
得物客服热线的演进之路
随机推荐
Battle Atlas: 12 scenarios detailing the requirements for container safety construction
[etc.] what are the security objectives and implementation methods that cloud computing security expansion requires to focus on?
[dark horse morning post] Huawei refutes rumors about "military master" Chen Chunhua; Hengchi 5 has a pre-sale price of 179000 yuan; Jay Chou's new album MV has played more than 100 million in 3 hours
[daily training -- Tencent select 50] 231 Power of 2
Help tenants
Mongodb command summary
2022-7-7 Leetcode 34.在排序数组中查找元素的第一个和最后一个位置
Enregistrement de la navigation et de la mise en service du robot ROS intérieur (expérience de sélection du rayon de dilatation)
[1] ROS2基础知识-操作命令总结版
Cmake learning and use notes (1)
Getting started with cinnamon applet
Is it safe to open an account online now? Which securities company should I choose to open an account online?
内存溢出和内存泄漏的区别
2022-7-6 Leetcode27.移除元素——太久没有做题了,为双指针如此狼狈的一天
华为镜像地址
Toraw and markraw
ROS机器人更换新雷达需要重新配置哪些参数
供应链供需预估-[时间序列]
flask session伪造之hctf admin
[1] Basic knowledge of ros2 - summary version of operation commands