Basic principles of PHP framework and selection criteria

Source: Internet
Author: User
Tags php basics php framework yii


  • Principles of the PHP framework

    Speaking of PHP framework, many novice PHP may feel a bit timid. In fact, the PHP framework is not so unfathomable, the framework is that others use the PHP Foundation is just for you to write the things, just packaged together, this is like we use PHP functions, functions are nearly written, we just follow the function of the rules, for example, to pass the number of parameters for the function, Type, and the value type returned by the function. Understanding the PHP functions of these rules of use, we can be bold, rest assured to use. Similarly, the PHP framework has its own rules, such as the deployment of project folders, naming rules for controller classes, and naming rules for data tables. Knowing the rules of the PHP framework, we can use all the functionality provided by the PHP framework.

    PHP Framework is not so inaccessible, each PHP programmer should be added to the PHP framework of learning and use, after all, a person's energy is limited, how you each project is developed by yourself, then you will waste a lot of time to do the same thing. For example, almost every project has data validation, so you have to write data validation PHP code for each project, and if you use the PHP framework, these are encapsulated and can be used directly.

    PHP Framework is also used in the basic knowledge of PHP to write, there is no need to see the framework of the two words to retreat. Learning PHP Framework is a simple and happy thing to know about PHP basics. The use of the framework will save about 50% of the project cycle time for your project.

    Advantages of the PHP framework

    1, PHP framework makes the code more secure. In general, the PHP framework uses a single-entry file mode, and we only have to validate the entry file to achieve the purpose of all file validation.

    2, the PHP framework shortens the project development cycle, which may be the greatest advantage.

    3, the use of PHP framework architecture projects Clear thinking, structure is obvious.

    PHP Framework Selection criteria

    In so many PHP MVC frameworks, how do you choose a framework that is good in every way and use it in your project? This is the problem that every phper will face. For example, the current more popular frameworks are: Zendframework, thinkphp (Domestic), CodeIgniter, Yii and so on. Everyone in the mind of good or bad standards, coupled with some people accustomed to a framework, want to let him accept his excellent framework is also more difficult. So, how should we judge whether a frame belongs to itself and becomes very prominent. Now I give a few criteria:

      • Performance
        The so-called performance refers to several metrics such as IO, CPU usage, PHP parsing time, and so on. The most prominent problem with the current server is that the CPU is already very fast, the memory is large enough to be cheap, but the hard disk IO is not high enough. It's like an IQ of 150 with an IQ of 80 people do the same, the superiority of IQ can not be realized at all.
      • full stack
        Although I personally do not agree with PHP framework over-the-full stack. However, I am also very excited if I can make the whole stack elegant and concise. What is full-stack? It's a framework that contains everything in web development. For example: Upload, paging, import and export, mail, log, error, QR code, RSS, RBAC and so on. In this way, we can really solve the problem of our own realization, save our time. It also improves the portability of code security.
      • Learning difficulty is steep
        after all, we have to apply the actual project. In the future, more people will be added into the project development. If the learning difficulty is too steep, it will inevitably affect the progress of the project and the cost of later maintenance. At present, I used the framework of thinkphp do a good job, the document is more complete and understandable. It is a headache to replace the yii frame that is being used. The documentation provided is simply too simple and the sample is not rich enough. Moreover, the code is not elegant enough. In some designs, being overly object-oriented makes it not particularly handy to operate in a language like PHP.
      • Frame Society Active
        A community is active or not, directly related to the future destiny of this framework. No one wants to be a very well-off frame today because it has not kept pace with the times and eventually drowns in the long river of history. You have to take the time to master the new framework. For example, the first few days of MongoDB or compared to fire, when there is almost no framework in the DB layer, that is ORM implementation of this database interface. You might consider using MongoDB in your project. At the time, several well-known and relatively fast frameworks were not supported. As a result, we have supported the domestic thinkphp. Although, the bug may be a bit more. At the very least, it is necessary to explain to a certain extent an active community.
      • Frame used by the framework
        A frame is a big game if no one is using it. You have learned can only in their own acres of three points of achievement. Out of this circle, the effect is not obvious. Phper to learn this thing, mainly in order to find a high-paying job. If, for a long while, no one has used this framework in the project. That's quite a sad reminder.

Fundamentals of the PHP framework and selection criteria

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: info-contact@alibabacloud.com 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.