是否使用 PHP 框架? [英] To Use a PHP Framework or Not?

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

问题描述

我已经开始用 PHP 编写一些应用程序,而且我对这门语言越来越熟悉.有人告诉我 CakePHP 和 CodeIgniter.我想更好地了解这些如何帮助我,以及是否值得花时间学习一个框架?

解决方案

使用 MVC PHP 框架有什么好处?

嗯,使用 PHP 框架有很多好处,让我们看看使用它们的一些主要好处.

  1. 这些 PHP 框架遵循一些设计模式,因此当您使用框架时,您必须遵循它们的编码约定,这使您的代码干净且可扩展以供将来使用.
  2. CakePHP、CodeIgniter、Zend Framework 和 Symfony 等流行的 PHP 框架都遵循模型视图控制器 (MVC) 设计模式,该模式将业务逻辑与用户界面分离,同时使代码更简洁且可扩展.
  3. 正如每个人都猜到的那样,这些框架包含许多库,可以让您的工作更轻松.例如:要验证表单,您不必像在正常编码场景(不使用框架)中那样编写那么多代码,通常只需调用库的几行代码就足够了.
  4. 在团队中处理大型项目时,MVC PHP 框架将是一个很好的开发工具,因为您可以指派开发人员为开发人员开发模块的一部分,并且这些开发的模块的集成将非常容易在最终级别.
  5. 这些 MVC 框架确实可以帮助您快速开发项目,如果您熟悉一个框架,那么您将永远不会担心项目的截止日期.
  6. 这些 MVC 框架中的大多数都使用清晰的 url 方法,使您的 Web 项目对 SEO 友好.

查看文章

I've started writing a few applications in PHP, and I'm becoming more familiar with the language. Someone told me about CakePHP, and CodeIgniter. I wanted to get a better understanding of how these could help me, and whether it's worthwhile spending the time to learn a framework?

解决方案

What are the benefits of using MVC PHP frameworks ?

Well there are many benefits of using PHP frameworks, let’s see some of the main benefits of using them.

  1. These PHP frameworks follow some design pattern, so when you use a framework you have to follow their coding convention, which makes your code clean and extensible for future purposes.
  2. The Popular PHP frameworks like CakePHP, CodeIgniter, Zend Framework, Symfony follow Model View Controller (MVC) design pattern which separates business logic from user interface, also making the code cleaner and extensible.
  3. As everybody can guess, these frameworks contain a lot of libraries to make your job easier. For example: to validate a form you don't have to write as much code as you have to do in normal coding scenario (without using a framework), just a few lines of code calling the library is usually enough for it.
  4. While working on a large project in a team, an MVC PHP framework will be a great tool for development as you can assign a developer to develop one part of a module for a developer and integration will be quite easy of these developed modules at final level.
  5. These MVC frameworks really help you to develop the project rapidly, if you know a framework well then you'll never worry about the project deadline.
  6. Most of these MVC frameworks use clear url approach making your web project SEO friendly.

check article

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

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