当前位置:网站首页>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
边栏推荐
- Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
- Write it down once Net a new energy system thread surge analysis
- [1] ROS2基础知识-操作命令总结版
- 干货|总结那些漏洞工具的联动使用
- Help tenants
- ROS机器人更换新雷达需要重新配置哪些参数
- Clion mingw64 Chinese garbled code
- Use of polarscatter function in MATLAB
- 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)
- Flink | multi stream conversion
猜你喜欢

1、深拷贝 2、call apply bind 3、for of for in 区别

2022-7-6 Leetcode 977.有序数组的平方

Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf

Ways to improve the performance of raspberry pie

高端了8年,雅迪如今怎么样?

DID登陆-MetaMask

Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)

Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou

Esp32 ① compilation environment

Realize the IP address home display function and number home query
随机推荐
室内ROS机器人导航调试记录(膨胀半径的选取经验)
Cinnamon taskbar speed
Shell batch file name (excluding extension) lowercase to uppercase
2022-7-7 Leetcode 34.在排序数组中查找元素的第一个和最后一个位置
社会责任·价值共创,中关村网络安全与信息化产业联盟对话网信企业家海泰方圆董事长姜海舟先生
User management summary of mongodb
Help tenants
数字ic设计——SPI
Distributed transaction solution
"Song of ice and fire" in the eleventh issue of "open source Roundtable" -- how to balance the natural contradiction between open source and security?
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
Server to server (S2S) event (adjust)
交付效率提升52倍,运营效率提升10倍,看《金融云原生技术实践案例汇编》(附下载)
How did Guotai Junan Securities open an account? Is it safe to open an account?
Leecode3. Longest substring without repeated characters
Getting started with cinnamon applet
LIS longest ascending subsequence problem (dynamic programming, greed + dichotomy)
QQ的药,腾讯的票
Xshell connection server changes key login to password login