为什么在 Laravel 5.x 中不推荐使用 Form 和 HTML 助手?

Why are Form and HTML helpers deprecated in Laravel 5.x?(为什么在 Laravel 5.x 中不推荐使用 Form 和 HTML 助手?)
本文介绍了为什么在 Laravel 5.x 中不推荐使用 Form 和 HTML 助手?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

为什么从 Laravel 5 开始不推荐使用 Form 和 HTML 助手?我知道我可以使用诸如 laravelcollective/html 包之类的东西.但我只是想知道为什么 Laravel 停止使用/下放助手.

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.

推荐答案

答案很简单.

Taylor Otwell 决定从核心组件中删除 Form 和 Html,因为它应该由社区通过诸如 之类的包来维护https://github.com/LaravelCollective/html.几乎没有其他组件被移除以保持框架纤薄.不是每个人都使用 Form 和 HTML ,我个人更喜欢纯 HTML .

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.

我的意见

我对此的一个看法是性能问题,如果您检查 Form 和 HTML 类,您将看到表单实际是如何生成的,这涉及使用 foreach 和其他脚本进行循环,只是为了生成简单的当您在刀片中使用纯 HTML 时,这种形式根本不会发生.

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 表单 &HTML 组件在完全自定义方面也有局限性,但是当您在 Blade 中使用纯 HTML 时,您可以随意自定义表单,任何前端开发人员都可以在不学习 Laravel 或 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.

我实际上认为 Laravel Form &HTML 适合懒惰的开发人员,我认为 :)

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

你可以不用 Form &Html 构建器完全或者你可以使用可用的包

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

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)