当前位置:网站首页>Laravel Form-builder使用
Laravel Form-builder使用
2022-07-07 11:47:00 【全栈程序员站长】
添加formbuilder插件:
Composer应用
composer require kris/laravel-form-builder
下载成功
修改配置文件
在config/app.php
‘providers’ => [
Kris\LaravelFormBuilder\FormBuilderServiceProvider::class,
]
‘aliases’ =>[
'FormBuilder' => Kris\LaravelFormBuilder\Facades\Formbuilder::class,
]
创建form
Php artisan make:form Forms/名字–fields =“name:text,intro:text”
生成的文件
public function buildForm()
{
$this ->add('name', 'text', [ 'rules' => 'required|min:5' ]) ->add('lyrics', 'textarea', [ 'rules' => 'max:5000' ]); }
创建一个空的form
Php artisan make:form Forms/名字
public function buildForm()
{
}
控制器
引用:
use Kris\LaravelFormBuilder\FormBuilder;
函数:
public function create(FormBuilder $formBuilder){ $form = $formBuilder->create(\App\Form\PostForm::class,[ 'method' => 'POST', 'url' => route('photo.store') ]); return view('Photo.form',compact('form')); }
视图:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> </head> <body> {!! form($form) !!} </body> </html>
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113276.html原文链接:https://javaforall.cn
边栏推荐
- 2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
- Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
- User management summary of mongodb
- Dry goods | summarize the linkage use of those vulnerability tools
- move base参数解析及经验总结
- Vscade editor esp32 header file wavy line does not jump completely solved
- Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
- Write it down once Net a new energy system thread surge analysis
- 2022-7-6 Leetcode 977. Square of ordered array
- Thread pool reject policy best practices
猜你喜欢
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
118. Yanghui triangle
供应链供需预估-[时间序列]
【黑马早报】华为辟谣“军师”陈春花;恒驰5预售价17.9万元;周杰伦新专辑MV 3小时播放量破亿;法华寺回应万元月薪招人...
Ogre introduction
得物客服热线的演进之路
Getting started with cinnamon applet
The delivery efficiency is increased by 52 times, and the operation efficiency is increased by 10 times. See the compilation of practical cases of financial cloud native technology (with download)
1、深拷贝 2、call apply bind 3、for of for in 区别
Cinnamon taskbar speed
随机推荐
一文读懂数仓中的pg_stat
TPG x AIDU | AI leading talent recruitment plan in progress!
Dry goods | summarize the linkage use of those vulnerability tools
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
2022-7-6 Leetcode 977. Square of ordered array
高端了8年,雅迪如今怎么样?
2022-7-6 使用SIGURG来接受外带数据,不知道为什么打印不出来
Supply chain supply and demand estimation - [time series]
Toraw and markraw
我那“不好惹”的00后下属:不差钱,怼领导,抵制加班
[QNX hypervisor 2.2 user manual]6.3.4 virtual register (guest_shm.h)
C语言数组相关问题深度理解
toRaw和markRaw
How did Guotai Junan Securities open an account? Is it safe to open an account?
Help tenants
PHP - laravel cache
Indoor ROS robot navigation commissioning record (experience in selecting expansion radius)
LIS longest ascending subsequence problem (dynamic programming, greed + dichotomy)
Introduction and basic use of stored procedures
[1] Basic knowledge of ros2 - summary version of operation commands