First knowledge of Laravel,laravel
#缘由
These two days, I am doing a small job of a small function, think anyway now time is not urgent, I will try a new tool, Laravel.
#Laravel官网:
#Laravel哲学
Laravel is a Web application development framework that has an expressive and concise syntax. We believe that the development process should be a pleasant, creative experience. Laravel strives to eliminate the pain in the development process, so we provide tools or features that are often used in development processes such as validation (authentication), routing (routing), Session, and caching (caching).
The goal of Laravel is 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 have the strength to focus on laravel, which is even based on the development of languages or tools such as Ruby on Rails, ASP. NET MVC, and Sinatra.
Laravel is easy to understand and powerful, and it provides powerful tools for developing large, robust applications. Outstanding IOC, database migration tools, and tightly integrated unit test support that give you the ability to build any application.
#我的体验
Background management system workload is relatively large, I am ready to plan the database, first to do the foreground.
So, the wonderful place, I was on YouTube random search (you have not read wrong, is youtube! The education network can be accessed directly! As long as there is IPv6 connection, you can directly access, do not need a VPN agent does not need to goagent do not need dedicated DNS and even do not need the hosts file.
I follow this video to do, found always unsuccessful, later found that this is a sublime plugin Laravel Generator. Install plug-ins, found that plug-ins need to PHP5.4, and I although 5.3 5.4 5.5 are installed, but in the local development or always use 5.3, because currently I manage all the servers are 5.3. Why ask for 5.4? It's also a question of using the [] method to define an array. Have a chase, finally can start to do.
Miracles happen at this time! Within one hours, from the state of the database is not planned, to a full front page, dependent on the database, including the Foreach loop, using the bootstrap streaming layout, a full page can be published! I also shouted in the group, laravel productivity is too high!
#结语
From around 0 o'clock to come out the first front page, to 03:40 about to finish, I learn while doing, while looking at the document side to do, a small project of a small function to complete, is beyond I used CI productivity. Let's share it with you later.
What is Laravel?
It frees you from the messy code of noodles, and it helps you build a perfect web app, and every line of code can be concise and expressive. 1, Bundle is Laravel expansion package organization form or salutation. Laravel's expansion pack warehouse is quite mature and can easily be used to install expansion packs (bundles) into your application. You can choose to download an expansion pack (bundle) and then copy it to the bundles directory, or install it automatically via the command line tool "Artisan". 2, in Laravel already has a set of advanced PHP ActiveRecord implementation-eloquent ORM. It makes it easy to apply "constraints" to both sides of the relationship, so you have full control over the data and enjoy all the conveniences of ActiveRecord. Eloquent native supports all methods of the query constructor (Query-builder) in fluent. 3. Application logic (application logic) can be implemented either in the controller (controllers) or directly into the route declaration, and the syntax is similar to the Sinatra framework. Laravel's design philosophy is to give developers maximum flexibility to create very small websites and build large enterprise applications. 4. Reverse Routing (Reverse Routing) gives you the ability to create a link (URI) by routing (routes) name. Simply use the route name, Laravel will automatically help you create the correct URI. This way you can change your routing (routes) at any time, and Laravel will automatically update all relevant links for you. 5. RESTful controller (restful Controllers) is an optional way to differentiate between get and post request logic. For example, in a user login logic, you declare a get_login () action to handle the service that gets the landing page, and also declare a post_login () action to verify the data that the form is post, and after verification, Make a decision to re-turn (redirect) to the landing page or to the console. 6. The auto-load class (class auto-loading) simplifies the loading of classes, so that it is not necessary to maintain automatic loading of configuration tables and non-essential component loading work. When you want to load any library or model, use it immediately, and Laravel will automatically load the required files for you. 7. View composers is essentially a piece of code, whichThe segment code is automatically executed when the view is loaded. The best example is the blog side of the random article recommendation, "View Assembler" contains the logic to load the recommended random article, so that you only need to load the content area of the Views (view) on the line, the other things laravel will help you to do it automatically. 8. The Reverse control container (IoC container) provides a convenient way to generate new objects, instantiate objects at any time, and Access Singleton (singleton) objects. Reverse control (IoC) means that you hardly need to intentionally load external libraries (libraries) to access them anywhere in your code, and you don't have to tolerate cumbersome, redundant code structures. 9. Migration (migrations) is like a version control tool, but it manages the database paradigm and is integrated directly into the laravel. You can use the "Artisan" command-line tool to generate and execute "migration" instructions. When your team member changes the database paradigm, you can easily update the current project through the version Control tool and then execute the "migration instructions," OK, your database is up to date! 11. The automatic paging (Automatic pagination) feature avoids the mixing of a large number of unrelated paging configuration codes in your business logic. Convenient is no need to remember the current page ... Remaining full text >>
$this[' key ' form principle in Laravel
Laravel no concept $this [' key '] this is not very generic, like a PHP array
$arr = Array ("1" =>32, "2" =>30, "3" =>34);
echo $arr [' 1 '];
?>
$this the current array or class bar $this [' key '] is more key to get value is it reasonable or other meaning?
http://www.bkjia.com/PHPjc/903479.html www.bkjia.com true http://www.bkjia.com/PHPjc/903479.html techarticle the first knowledge laravel,laravel #缘由 These two days, I am doing a small job of a small function, think anyway now time is not urgent, I will try a new tool, Laravel. #Laravel官网截...