当前位置:网站首页>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
边栏推荐
- Final review notes of single chip microcomputer principle
- 实现IP地址归属地显示功能、号码归属地查询
- 《厌女:日本的女性嫌恶》摘录
- Shell batch file name (excluding extension) lowercase to uppercase
- Battle Atlas: 12 scenarios detailing the requirements for container safety construction
- Help tenants
- Ways to improve the performance of raspberry pie
- 单片机学习笔记之点亮led 灯
- Esp32 construction engineering add components
- Cmake learning and use notes (1)
猜你喜欢
1、深拷贝 2、call apply bind 3、for of for in 区别
2022-7-7 Leetcode 844. Compare strings with backspace
实现IP地址归属地显示功能、号码归属地查询
Co create a collaborative ecosystem of software and hardware: the "Joint submission" of graphcore IPU and Baidu PaddlePaddle appeared in mlperf
最佳实践 | 用腾讯云AI意愿核身为电话合规保驾护航
1. Deep copy 2. Call apply bind 3. For of in differences
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
社会责任·价值共创,中关村网络安全与信息化产业联盟对话网信企业家海泰方圆董事长姜海舟先生
cmake 学习使用笔记(一)
Redis can only cache? Too out!
随机推荐
Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
ES日志报错赏析-Limit of total fields
作战图鉴:12大场景详述容器安全建设要求
数字ic设计——SPI
【堡垒机】云堡垒机和普通堡垒机的区别是什么?
toRaw和markRaw
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
Deep understanding of array related problems in C language
Flink | 多流转换
[etc.] what are the security objectives and implementation methods that cloud computing security expansion requires to focus on?
Leetcode simple question sharing (20)
2022-7-6 beginner redis (I) download, install and run redis under Linux
实现IP地址归属地显示功能、号码归属地查询
2022-7-7 Leetcode 34.在排序数组中查找元素的第一个和最后一个位置
Read PG in data warehouse in one article_ stat
118. 杨辉三角
Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
Move base parameter analysis and experience summary
为租客提供帮助
Mongodb command summary