In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the difference between laravel and tp". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the difference between laravel and tp".
Differences: 1, render the template in different ways, Laravel with "return view ()", tp with "$this- > display ()". 2. Different ways to prevent cross-station attacks. 3. Laravel can use routing to access all functions, but not TP. 4. Conditional judgment sentences are written in different ways.
The operating environment of this tutorial: windows7 system, Laravel6&&ThinkPHP6 version, Dell G3 computer.
The difference between laravel and ThinkPHP
1: different ways of rendering templates:
1: in the Laravel framework, use return view () to render the template
2:ThinkPHP uses the method of $this- > display () to render templates.
Second, different ways to prevent cross-site attacks
1: in the Laravel framework, because it takes into account cross-site request forgery, if you use the form form to post the value, if you do not add {{csrf_field ()}} to the form form, the syntax error of TokenMethodnotfound will be reported.
2: the TP framework needs to manually complete the code to prevent cross-site attacks.
Third, different access methods
1:Laravel is a rerouting framework, all functions are initiated by routing, even if there is no controller method, as long as the route is written, it can be accessed.
2:thinkPHP must have a controller method to access it properly.
Fourth, the different ways of writing conditional judgment sentences.
In 1:Laravel framework, if else judgment statement and foreach statement must start with @ if and end with @ endif. If not, a syntax error is reported. @ foreach @ endforeach is the same.
The 2:TP framework is consistent with the use of PHP grammar rules, direct ifesle statement judgment and foreach loop traversal.
Five: different developers
1. Laravel is a world-class development framework opened up by foreign people, so there are many people from all over the world to improve this framework. If you use laravel, you will find that it updates very fast, its function is also very powerful, and its design ideas are also in line with some of the current needs. In addition, the laravel community is also very active, if you encounter related problems, you can better ask for help.
2, the tp framework is a domestic open source development framework, the number of users in China has been very large, especially to beginners may prefer to use it, because its design is more in line with the habits of Chinese people, and Chinese documents are clearer and easier to use. But after all, its regional limitations are not as avant-garde as laravel in the design of the framework, although it has been closely followed by upgrades. (for example, when I switched from tp to laravel, tp didn't use the concept of containers, middleware or anything, but it didn't take long to find that all of these were implemented by it in its new version.)
Undefined
Thank you for your reading, the above is the content of "what is the difference between laravel and tp". After the study of this article, I believe you have a deeper understanding of the difference between laravel and tp, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.