Laravel and laravel_PHP tutorials

Source: Internet
Author: User
Tags form post ruby on rails
First recognized Laravel and laravel. I first got to know Laravel, laravel #. I am working on a small feature in the last two days. I think it's not a rush. I will try the new tool Laravel. # Laravel

# Reason

In the past two days, I am working on a small function for a small job. I think it's not a rush to get started. I will try the new tool Laravel.

# Laravel official website:

# Laravel philosophy

Laravel is a web application development framework with expressive and concise syntax. We believe that the development process should be a pleasant and creative experience. Laravel strives to eliminate the pain points in the development process, so we provide tools or functions that are frequently used in the development process, such as authentication, routing, session, and cache.

Laravel aims to create a pleasant development process for developers without sacrificing the functionality of the application. Happy developers can create the best code! For this purpose, we concentrate on Laravel, which is based on development languages or tools such as Ruby on Rails, ASP. net mvc, and Sinatra.

Laravel is easy to understand and powerful. It provides powerful tools for developing large-scale and robust applications. Outstanding IoC, database migration tools, and tightly integrated unit test support give you the ability to build any application.

# My experience

The background management system is heavy, so I have prepared and planned the database and started the foreground first.

As a result, I randomly searched YouTube for the highlights (you are not mistaken, it is Youtube! You can access CERNET directly! As long as there is an ipv6 connection, you can access it directly. no VPN is required, no proxy is required, no GoAgent is required, no private dns is required, and no hosts file is required.

I followed this video and found that it was always unsuccessful. later I found this was a sublime plug-in Laravel Generator. After installing the plug-in, I found that PHP5.4 is required for the plug-in. although I have installed 5.3 5.4 5.5, I still use 5.3 for local development because all the servers I manage are 5.3. Why 5.4? Are you still using the [] method to define arrays. After a large transaction, we can finally start.

A miracle occurred at this time! Within an hour, the entire front-end page is displayed, depending on the database, including the foreach loop, using the Bootstrap stream layout, and publishing! I yelled at the group, and Laravel's productivity was so high!

# Conclusion

The first front-end page is displayed at around, and is finished at around. I learned and did it while checking the document. a small item and a small function are completed, it is beyond the productivity of using CI. I will share it with you later.

What is Laravel?

It can free you from the messy code like a noodle; it can help you build a perfect web APP, and each line of code can be concise and expressive. 1. Bundle is the extended package organization form or name of Laravel. Laravel's extension package repository is quite mature and can easily help you install the extension package (bundle) into your application. You can download an extension package (bundle) and copy it to the bundles directory, or use the command line tool "Artisan" for automatic installation. 2. Laravel already has an advanced PHP ActiveRecord implementation-Eloquent ORM. It can easily apply constraints to the two sides of the relationship, so that you have full control over the data and enjoy all the conveniences of ActiveRecord. Eloquent native supports all query-builder methods in Fluent. 3. Application Logic can be implemented in the controller or directly integrated into the route declaration. The syntax is similar to that of the Sinatra framework. Laravel's design philosophy is to provide developers with the maximum flexibility, both creating very small websites and building large-scale enterprise applications. 4. Reverse Routing gives you the ability to create a link (URI) using a routes name. You only need to use the route name. Laravel will automatically create the correct URI for you. In this way, you can change your routes at any time. Laravel will automatically update all related links. 5. Restful controller (Restful Controllers) is an optional method to differentiate the GET and POST request logic. For example, in a user login logic, you declare a get_login () action to process the service that obtains the login page, and also declare a post_login () action (action) to verify the data in the form POST, and after the verification, make the decision to redirect (redirect) to the login page or to the console. 6. the automatic loading Class simplifies the loading of the class. in the future, you do not need to maintain the automatic loading of configuration tables and non-essential components. When you want to load any library or model, use it immediately. Laravel will automatically help you load the required files. 7. View Composers is essentially a piece of code, which is automatically executed when the View is loaded. The best example is the recommendation of side random articles in the blog. the "view assembler" contains the logic for loading the recommendation of random articles. in this way, you only need to load the view of the content area) that's it. Laravel will automatically complete other tasks. 8. IoC container provides a convenient way to generate new objects, instantiate objects at any time, and access singleton objects. IoC means that you can access these objects from any location in the code without having to specifically load external libraries, it does not need to endure complicated and redundant code structures. 9. migration is like version control. However, it manages the database paradigm and is directly integrated into Laravel. You can use the "Artisan" command line tool to generate and execute the "migration" command. When your team members change the database paradigm, you can easily update the current project using a version control tool, and then execute the "migration command, your database is up to date! 11. the Automatic Pagination function prevents a large number of irrelevant page configuration code from being incorporated into your business logic. It is convenient that you do not need to remember the current page... the remaining full text>

$ This ['key'] format principle in laravel

Laravel has no concept. $ this ['key'] is not very common in writing like a php array.
$ Arr = array ("1" => 32, "2" => 30, "3" => 34 );
Echo $ arr ['1'];
$ This is an array or class. $ this ['key'] is it reasonable to obtain value based on the key?

Tips # The reason is that I am working on a small feature in the past two days. if you think about it, I am not in a hurry. I will try the new tool Laravel. # Laravel official website cut...

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