A senior designer tells us that PHP has three major reasons for future trends.
1. PHP is a great web development language that provides countless tools and class libraries.
However, when you try to create a website separately, you can either writeCodeOr use third-party code.
All excellent PHP frameworks provide you with class libraries and helper functions. They can help you with the following:
Form verification;
Input and Output data filtering;
Database abstraction;
Session and cookie processing;
Email, calendar, and paging ......
There are countless examples. What's more, there are someCommunityYou can add a large number of plug-ins to your framework.
2. The famous MVC pattern dates back to 1979. It was first proposed by a Norwegian computer scientist named Harvey.
PHP itself works like a template engine. However, if you use it unresponsibly, it will make your code ugly and make it difficult to maintain the code.
MVC mode:
Model: usually represents your data structure and database interface;
View: contains the Page Template and output;
Controller: Process page requests.
This separation makes the code more clean and easy to maintain.
3. In PHP, you may have thought of many ways to filter the input and output to prevent your website from being attacked. Manual processing of these filters will be exhausting. When you use the framework, you can forget the tired ones.
For a framework, most of the filtering work can be completed automatically. For example, codeigniter framework:
Any database value is filtered to prevent SQL injection attacks.
All HTML files can be automatically generated, such as form-assisted functions and URL-assisted functions.
All user input data can be filtered to prevent XSS attacks.
To encrypt a cookie, you only need to change the configuration option.
Is it long-sighted? PHP must be the trend of the future.