为什么要使用 PHP 框架?

2022-01-16 00:00:00 frameworks php

我很好奇,使用 PHP 框架有哪些优点(和缺点)?

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

我从版本 3 开始就一直在使用 PHP.我从未使用过任何可用于 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 将您从低级细节中抽象出来,提高您的工作效率,并保护您免受低级错误(例如防止 SQL 注入攻击).

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

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

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

相关文章