为什么在Laravel 5.x中不推荐使用Form和HTML helpers? [英] Why are Form and HTML helpers deprecated in Laravel 5.x?

查看:157
本文介绍了为什么在Laravel 5.x中不推荐使用Form和HTML helpers?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么自Laravel 5以来,表单和HTML帮助器已被弃用?我知道我可以使用像 laravelcollective / html 包。但我只是想知道为什么Laravel停止使用/ devolve helpers。

解决方案

答案很简单。
$ b Taylor Otwell决定从核心组件中删除Form和Html,因为它应该由社区通过诸如 https://github.com/LaravelCollective/html 。几乎没有其他组件被删除,以保持框架苗条。不是每个人都使用表单和HTML,我个人更喜欢纯HTML。

我的意见



我对此的一个看法是表现问题,如果你检查Form和HTML类,你会看到如何生成表单,这涉及到循环与 foreach 和其他脚本只是为了生成简单的表单,你在你的刀片中使用纯粹的HTML。



Laravel Form& HTML组件在完全自定义方面也有局限性,但是当您在刀片中使用纯HTML时,您可以随意自定义表单,任何前端开发人员都可以在不学习Laravel或Blade的情况下理解它。



我其实认为Laravel Form& HTML是针对懒惰的开发者的,我认为:)

你可以不使用Form& Html的建设者,或者你可以使用可用的软件包


Why are the Form and HTML helpers deprecated since Laravel 5? I know I could use something like laravelcollective/html packages. But I was just wondering why Laravel stopped using/devolving the helpers.

解决方案

The answer is simple.

Taylor Otwell decided to remove Form and Html from core components because it's something that should be maintained by the community through packages like https://github.com/LaravelCollective/html. Few other components were removed to keep the framework slim. Not everyone uses Form and HTML , I personally prefer pure HTML.

My Opinion

One of my opinions on this is the issue of performance, If you check Form and HTML classes you will see how forms are actually generated, which involves looping with foreach and other script just to generate simple form which simply doesn't happen when you use your plain HTML in your blade.

Laravel Form & HTML components also have limitations in terms of full customization but when you use plain HTML in your blade you can freely customize the form in anyway you like and any front-end developer can understand it without learning Laravel or Blade.

I actually think Laravel Form & HTML are for lazy developers, my opinion :)

You can do without Form & Html builders completely or you can use available packages

这篇关于为什么在Laravel 5.x中不推荐使用Form和HTML helpers?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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