laravel 5.4:消失了.操纵表单的新方法是什么? [英] laravel 5.4: From is gone. What is the new way to manipulate forms?

查看:48
本文介绍了laravel 5.4:消失了.操纵表单的新方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在新的laravel 5.4项目中使用Form在刀片中进行操作

Doing something in a blade with Form in a new laravel 5.4 project, e.g.

{{ Form::hidden('data-name', $value->name) }}

将抛出:

Class 'Form' not found

有很多帖子可以尝试解决此问题(许多不同且相互矛盾的答案,有些需要编辑几个文件并运行命令),但我的问题是,处理表单的新正确"方法是什么?在laravel 5.x中,看到它已经被删除(并且添加回去是不平凡的)吗?

There are many posts with ways to try to fix this (many different and conflicting answers, some with several files needing to be edited and commands run), but my question is what is the new "correct" way to manipulate the form in laravel 5.x, seeing as it has been dropped (and adding back is non trivial)?

目前,我已经为laravel 5+使用了此选项:

Currently, I have resorted to this option for laravel 5+:

<input type="hidden" name="token" value="{{ app('request')->input('token') }}">

推荐答案

Laravel外部化了表单管理,这是以以前的方式({{ Form::open() }}),({{ Form::close() }})等实现的软件包.所有字段均在文档中.

Laravel externalized the management of Forms, Here is the package that implements it the way it used to be ( {{ Form::open() }} ), ( {{ Form::close() }} ) etc. All the fields are in the documentation.

这篇关于laravel 5.4:消失了.操纵表单的新方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆