[Mr. MAK] Beginner laravel framework differs from thinkphp 1 laravel Chinese Laravel College laravel Teaching

Source: Internet
Author: User
1. Render the template differently: in the Laravel frame, the return view (' URL path ') is used to render the template, while the thinkphp uses the->display () method to render the template;

2. In the actual development we often encounter this problem, that is, the development of the location is not fixed, which caused us to frequently change the database configuration, to the development of trouble, TP still do not avoid this "disaster", in the Laravel framework, the. Env environment file to solve the problem, We only need to configure the. env file to be configured at different locations, either git or SVN. Env is not submitted to the server along with the file ";

The 3.Laravel framework provides a large number of closures, and as a rookie I am currently only using the use method, that is, how to use the outer variables inside the function

Note Differences in 4.post values: In the Laravel framework, because it takes into account cross-site attacks, if you use form form to post a value, if you no longer add {{csrf_filed ()}} to the form form The Tokenmethodnotfound syntax error is reported, and the TP framework needs to manually complete the code to prevent cross-site attacks;

5. The difference in the writing of conditional judgments: if Else judgment statements and foreach statements in the Laravel framework must begin with @if at the end of the @endif, and if no syntax errors are reported, @foreach @endforeach the same; The TP framework and the PHP syntax rules are used in the same way as direct Ifesle statement judgment and Foreach Loop traversal

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: 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.