为什么在PHP中使用框架? [英] Why use a framework with PHP?

查看:72
本文介绍了为什么在PHP中使用框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,在PHP中使用框架有什么优点(和缺点)?



自从版本3开始使用PHP以来, 。我从来没有使用任何可用于PHP的框架,所以我错过了什么?

解决方案

框架将摘要从低级别的细节,使您更有效率,并保护您免受低级别的错误(如防止SQL注入攻击)。



一个好的PHP框架迫使你分开你的关注和实施经过验证的架构,最终改进您的设计,并使您的代码更易于阅读和维护以及单元测试。

以下是关于为什么你应该 rel =noreferrer> >使用框架


I'm curious, what are the advantages (and disadvantages) on using a framework with PHP?

I've been using PHP on and off since version 3. I've never used any of the frameworks available for PHP, so what am I missing out on?

解决方案

Framework abstracts you from low level details, makes you more productive, and protects you from low level error ( such as preventing SQL injection attacks).

A good PHP framework forces you to separate your concern and implements the proven architecture, which in the end improves your design, and makes your code much easier to read and maintain and unit test.

Here are some references on why you should use framework

这篇关于为什么在PHP中使用框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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