Foreign mainstream PHP framework comparison-codeigniter, CakePHP, zendframework, symfony_php tutorials

Source: Internet
Author: User
Tags php framework codeigniter zend framework
Recently simple use of the current domestic use of a number of major foreign PHP framework (excluding the domestic framework), roughly to these frameworks have an intuitive feeling, simple to share, for which to do frame selection, right when a reference.
The main reference frameworks include: CodeIgniter, CakePHP, Zendframework, Symfony
Description: I have no serious use of many frameworks, just a simple trial, may be a lot of ideas immature or wrong, please correct me, grow together.
Official website:
Chinese website:
Chinese Manual: Http://
Video Tutorial: Http://
Beta version: codeigniter_1.6.1
1. Simple configuration, all the configuration using PHP script configuration, execution efficiency, with basic routing capabilities, to a certain degree of routing, with the initial layout function, to create a certain degree of interface appearance; database layer encapsulation is good, with basic MVC function
2. Fast and concise, code is not many, high performance, simple framework, easy to use, low learning cost, document details; With a lot of easy to use library, framework for small applications
1. Simply understand the model layer as a database operation
2. The frame is simple enough to meet small applications, slightly less able to meet the needs of midsize applications
Overall, take CodeIgniter to complete the simple and fast application is worth, at the same time can construct a certain degree of layout, easy to reuse the template, the data operation layer is good encapsulation, and codeigniter not use many too complex design patterns, Good execution performance and code readability. As for the additional library is also good, concise and efficient.
Official website:
Chinese Manual:
Video Tutorial:
Beta version: cake_1.1.19.6305
1. CakePHP is the most similar to the ROR framework, including the design method, the database operation of the active record mode, the design level is elegant, no redundant library, all the functions are purely framework, execution efficiency is good; database layer HasOne, Hasmany function is very powerful, more suitable for complex business processing, routing function, configuration function is good, automatic building scaffolding (scaffold) is very powerful, suitable for medium-sized applications, basic implementation of MVC every layer, with automatic command line script function;
2. Document comparison of the whole, in the domestic promotion of comparative success, most of them know cakephp, learning costs Moderate
1. The very serious problem with cakephp is that the model is understood as a database-level operation that severely affects operational capabilities beyond the database
2. CakePHP's cache function is slightly weak, the configuration function is slightly weak; CakePHP is not suitable for large applications, it is suitable for medium-sized applications, and small-scale applications are slightly more expensive to learn.
In general, the cakephp framework represents a very important era and representative of PHP framework, and currently plays a very important role, many of their own framework has been copied to imitate the way cakephp, is a milestone product; CakePHP revealed that Ror's agile approach to development and the idea of database manipulation as the only model was a great tool for developing rapid applications and prototypes, and that the development framework used to make Web2.0 sites was also worth choosing.
"Zend Framework"
Official website:
Chinese Manual: Http://
Video Tutorial:
Beta version: ZendFramework-1.5.0
1. The official production, with a very large library, the framework itself using a lot of design patterns to write, architecture is elegant, the implementation of medium-efficiency; MVC design, relatively concise, with the routing function, the configuration file is more powerful (capable of processing XML and PHP INI), the various libraries are very powerful, all PHP framework is the most comprehensive features, including it is not only a framework, but also a large class library (replace Pear), which is its main feature , it can intuitively support the model layer except database operation (stronger than CodeIgniter and CakePHP), and can easily use loader function to load other newly added classes; Cache is very powerful, from the front-end cache to the back-end cache support, back-end cache support Memcache, APC, SQLite, files and so on; Database operation is very powerful, support various drivers (adapters)
2. The document is very full, in the domestic community is very mature, and at present a lot of Web 2.0 sites in use, learning cost medium
1. The MVC function is relatively weak, the view layer is simple to implement (as is not implemented), not very powerful control of the front-end page
2. No automation script, create an application, including the portal file, all must be built by hand, the cost of entry is high
3. The Zend framework as a medium-sized application framework is not a problem and can barely be used as a framework for large applications, but as a very mature large PHP framework, some effort is needed
As an official framework, the ambitions of the Zend framework are predictable, to squeeze out other frameworks, to encapsulate many powerful libraries, to provide one-stop framework services, and their development teams to be strong enough to develop powerful products. So the basic certainty is that the Zend framework will be promising, if it takes more time to refine the framework. Similarly, the Zend framework architecture itself is more elegant, indicating that the Zend official is a lot of experts, the design concept is more advanced, although some of the features are not perfect, such as the view layer, automation scripts, and so on, these depend on the future upgrade. In general, the Zend Framework is the most anticipated frame, and of course, it is absolutely no problem for you to invest in your project at the moment.
Official website:
Chinese website:
Authoritative guide: Http://
Study reference:
Beta version: symfony-1.0.13
1. Symfony is the most powerful PHP framework I know, and I use it for a long time, but many features have not been dug out, it completely implemented the MVC three layer, encapsulating everything, including $_post,$_get data, exception handling, debugging function, data detection; Contains powerful cache function, automatic loading class (this is very cool), strong i18n support, powerful view layer operation, can be fragmented to contain a single multiple files, very powerful configuration function, using YML configuration can control all framework and program running behavior, strong to people without words; Be able to define a variety of their own classes, and Symfony can automatically load the class, can be called at random in the program, including powerful multi-level project and Application management: Project--Application-- Module-to-action to meet the needs of multiple applications under one project, and each layer can define its own class library, configuration file, layout, and very powerful command line operation functions, including building projects, building applications, building modules, refreshing caches and so on;
2. Symfony is definitely the first choice for the development of large complex projects, because the use of symfony, will greatly save development costs, and when many people collaborate, there is no problem, after the project level is defined in the basic class, any module can be reused, greatly reuse the code
1. The database operation model uses heavyweight propel and Creole, but has moved them to the addon in the version I tested, which can be used
2. The cache function can not be controlled, each development debugging always cache, need to execute Symfony cc, Symfony RC to clear and rebuild the cache;
3. Efficiency is not very high, especially the process of parsing templates and reading configuration files, it takes a lot of time;
4. The cost of learning is very high, and there is no mature community and documentation in China, even the Chinese manual is not, the corresponding to master all functions, it takes more time
Symfony is definitely an enterprise-class framework, the only thing that can seem to be able to contend with the strong framework of the Java field, strong things, natural learning complex, but corresponding to the development of the project is also helpful, nature is recommended complex project use Symfony to deal with, feel is worth, The later maintenance cost is lower, the reusability is very strong. Corresponding if the use of symfony should be more complex Internet projects, then the corresponding to consider the problem of database distribution, then you need to abandon the symfony of the database operation layer, need their own definition, of course, symfony support arbitrary structure of the model layer.
General comments
The above frameworks are unique and open source projects, but the framework is different for projects, generally codeingiter is more suitable for small projects, CakePHP and Zend framework is more suitable for medium-sized projects, Symfony is more suitable for large heavyweight projects, When selecting a project, consider the customization and extensibility of the framework, as each project cannot determine whether you will change as your needs change.
Relatively speaking, the Zend framework and the Symfony have a stronger ability to cope with change, especially when it is possible to customize the class of the model layer, it is very convenient to add their own business or data processing classes, I am a personal comparison recommended in large and medium-sized projects used in the framework. Codeingiter and CakePHP also play a significant role in small and medium-sized projects, rapid development and prototyping, and are well suited for the development of prototype projects that are not clearly targeted. The best way to learn about a framework is to use it, and the best way to learn it is to watch the video. :-)
Benevolent See, in the project selection Framework, please carefully examine the project's needs and future changes, and then select the appropriate framework, so that the project development speed and later maintenance to get a reasonable balance, of course, perhaps, write a framework more suitable. :-)
The general evaluation of several frameworks, estimated that a lot of things are not mentioned in the point of view, we would like to look at it, also welcome the comments!
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.