当前位置:网站首页>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
边栏推荐
- 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)
- Enregistrement de la navigation et de la mise en service du robot ROS intérieur (expérience de sélection du rayon de dilatation)
- Indoor ROS robot navigation commissioning record (experience in selecting expansion radius)
- 【堡垒机】云堡垒机和普通堡垒机的区别是什么?
- Show the mathematical formula in El table
- JS function returns multiple values
- 得物客服热线的演进之路
- Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
- 干货|总结那些漏洞工具的联动使用
- .net core 关于redis的pipeline以及事务
猜你喜欢
Digital IC Design SPI
供应链供需预估-[时间序列]
2022-7-6 beginner redis (I) download, install and run redis under Linux
高等數學---第八章多元函數微分學1
C语言数组相关问题深度理解
实现IP地址归属地显示功能、号码归属地查询
【堡垒机】云堡垒机和普通堡垒机的区别是什么?
2022-7-6 Leetcode 977. Square of ordered array
Build a secure and trusted computing platform based on Kunpeng's native security
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
随机推荐
Flink | 多流转换
648. 单词替换 : 字典树的经典运用
[high frequency interview questions] difficulty 2.5/5, simple combination of DFS trie template level application questions
requires php ~7.1 -&gt; your PHP version (7.0.18) does not satisfy that requirement
How to make join run faster?
Redis只能做缓存?太out了!
C语言数组相关问题深度理解
Introduction and basic use of stored procedures
2022-7-6 beginner redis (I) download, install and run redis under Linux
[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
Solve the cache breakdown problem
供应链供需预估-[时间序列]
Getting started with MySQL
Navicat运行sql文件导入数据不全或导入失败
现在网上开户安全么?那么网上开户选哪个证券公司?
10 pictures open the door of CPU cache consistency
带你掌握三层架构(建议收藏)
PC端页面如何调用QQ进行在线聊天?
Mongodb command summary
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf