As a novice php how to learn a development framework, where to start, how to learn faster, more systematic learning?
Thinkphp get started fast, the function is relatively complete! online tutorials are plentiful. After reading to learn Codeigniter,zend Framework, Yii benefited a lot. The main reference PHP frameworks include:
。 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.
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, PHP framework is simple, 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. PHP Framework 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.
1. CakePHP is the most similar to ROR PHP 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 is slightly weak; cakephp is not suitable for large-scale applications, only 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 the PHP framework, and is now playing a very important role, many of their own framework has been modeled as a model of cakephp, is a milestone product CakePHP reveals that Ror's agile approach to development and the idea of database manipulation as the only model is a great tool for developing rapid applications and prototypes, and the development framework used to make Web2.0 websites is also worth choosing.
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 moderate efficiency; MVC design, relatively concise, with routing capabilities, configuration files are more powerful (able to handle XML and PHP INI), the various libraries are very powerful, is the most comprehensive of all PHP frameworks, including not only a PHP framework, but also a large class library (instead of pear), which is its main feature, can be intuitive to support in addition to the database operation of the model layer (more than CodeIgniter and CakePHP strong), and can easily use the loader function to load other new added Class;cache features are very powerful, from the front-end cache to the back-end cache support, back-end cache support Memcache, APC, SQLite, files and so on, the database operation function is very powerful, Supports various drives (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 PHP 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 PHP framework, and of course, it is absolutely no problem for you to invest in your project at the moment.
1. Symfony is the most powerful PHP framework I know, and I have been using it for a long time, but many features have not been dug out; it has completely implemented the MVC three layer, encapsulating everything including $_post,$_get data, exception handling, debugging functions, data detection , including powerful cache function, automatic loading class (This feature is very cool), strong i18n support, powerful view layer operation, can be fragmented to contain a single multiple files, very powerful configuration features, using YML configuration to control all framework and program operation Behavior, strong enough to make people without words , you can easily define your own class, and symfony can automatically load these classes, 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 PHP framework, the only thing that can seem to be able to compete with the Java field of the strong framework of things, strong things, natural learning complex, but corresponding to the development of the project is also helpful, nature is recommended complex projects using 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.
The above PHP frameworks are unique and open source projects, but the framework for the project is different, generally codeingiter is more suitable for small projects, CakePHP and Zend framework is more suitable for medium-sized projects, Symfony 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 strong ability to cope with change, especially if you can 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 projects in the use of PHP 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.
Do not start with the frame, otherwise it is easy to be circled by the frame. Start writing from the most basic PHP and then slowly encapsulate some of your own classes. In this process, you will be able to sort out a set of your own development classes, these classes can be said to be a framework, a unique frame of your own.
Now look at some popular frameworks, such as Yii, cakephp, and so on. Understand the idea of the framework and learn to use the framework flexibly instead of just restricting the API that the framework provides to you.
Remember when the use of thinkphp, too many people did not learn PHP, and even do not know what pear is the case, directly to get started. Although the functions provided by TP can be used to make a lot of things, it is not possible to encounter some documents that do not say or need to be used flexibly. This can be said to be the use of the framework of sorrow.
Bare Write php--> Use classes--> Understanding MVC (or understanding Design Patterns)-> Framework-> Flexible Use-> can use settings to modify the framework at will.
This is a sequence that I think is for reference only. Recommended CodeIgniter
1. Examples are detailed and can be used directly
2. Perfect Chinese documentation
3. The design of the framework itself is concise and powerful Phpmanul thank @justjavac for inviting
Condition: Novice, Frame
So first eliminate the medium (CakePHP, Yii), the large framework (ZF, Symfony), but also eliminate the irrelevantly replying written directly with the original code of the answer, then the rest is from the small PHP framework to make a choice. From the novice point of view, easy to use, good understanding is the most important, a suitable for the novice framework should meet the following conditions:
-Excellent, easy-to-understand documentation
-Gentle learning curve
-Lower learning costs
-Frame relative standard, not upset
-use more people, have problems to get even answer, community and other reference resources, tutorials Rich
-Do not add complex design patterns
-should have simple framework elements such as MVC, templates, models, class libraries, helper
In summary, recommendation: CodeIgniter
I have written a small framework for beginners who are just getting started: Phoenixg/phx GitHub
If you are a novice, you should first read the PHP manual and MySQL manual, the basic knowledge of the solid. This is the most important. If you want to learn PHP framework I strongly recommend doitphp, not for others, easy to get started. I started with fleaphp, and I personally think the framework notes are clear.
The example is also good.
Then there was contact with qeephp. The method of object chain query is very simple, but it is very cost-performance, now in the framework of the team's own writing. I used Drupal to develop a period of time, it is recommended that beginners do not use, the overall feeling for beginners is very difficult. Successively took over the project and successively used the wordpress,zendphp,thinkphp, feeling these too complex, the data is not very whole. The recent use of CI to do a larger project, in general, CI Chinese documents more detailed, and very lightweight, so many things have to write their own. If you want to learn CI, not only to understand the essence of MVC, but also to improve their language development level. The way to learn is to follow / http Codeigniter.org.cn/user _guide/index.html
The goal can be achieved. Start with the Zend Framework and master the operating mechanism. Do not be afraid of the complex, know the complex to do whatever you want to Jane.