Laravel 框架中的主要概念是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33049215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:28:52  来源:igfitidea点击:

What are the main concepts in the laravel framework?

phplaravellaravel-5laravel-5.1

提问by user5429739

I'm starting to use Laravel 5.1, I got knowledge in php, js, angular, express, node, apache, mysql, sqlserver, and some other things.

我开始使用 Laravel 5.1,我了解了 php、js、angular、express、node、apache、mysql、sqlserver 和其他一些东西。

In Angular I like that everything is built as singletons, so that the main concepts are: modules, controllers, services, factories, directives, routes, views, scopes, etc...

在 Angular 中,我喜欢一切都构建为单例,因此主要概念是:模块、控制器、服务、工厂、指令、路由、视图、范围等......

I'd like to know what concepts do I need to understand when building an app under laravel?

我想知道在laravel下构建应用程序时需要了解哪些概念?

回答by Jonathan Solorzano

Basically all you need to know is very well documented at the official documentation, Taylor Otwell made a huge effort doing the documentation to make the framwork more comprenhensible.

基本上,您需要知道的所有内容都在官方文档中得到了很好的记录,Taylor Otwell 付出了巨大的努力来编写文档以使框架更易于理解。

The basic concepts are:

基本概念是:

After that keep an eye to in the Middlewareconcept, also there's a plenty of built-in services as: Auth, Pagination, Encryption, etc... check them out.

之后留意中间件的概念,还有很多内置服务,如:身份验证、分页、加密等......检查一下。

Something you'll love is Eloquent ORM, it simplifies the interaction with the database.

您会喜欢Eloquent ORM,它简化了与数据库的交互。

Laravel community has their own site and that is laracastsyou could get help there too.

Laravel 社区有他们自己的网站,那是laracasts,你也可以在那里获得帮助。

回答by Moppo

One of the most important features of Laravel is the Service Container(you'll hear about it also as the IoC Container) and the way it's used to register Services, provide Dependency Injection, and be a Registry for your application.

Laravel 最重要的特性之一是服务容器(你也会听到它作为 IoC 容器)以及它用于注册服务、提供依赖注入和成为应用程序的注册表的方式。

Middlewareare one of my favorite feature of laravel: they are like filters executing before and after the requests, in which you can 'prepare' some data to be handled in the request or 'fix up' something after the request has been processed

中间件是我最喜欢的 laravel 功能之一:它们就像在请求前后执行的过滤器,您可以在其中“准备”一些要在请求中处理的数据或在请求处理后“修复”某些内容

Another peculiar feature are the Facades: (non to be confused with the homonym design pattern ) you'll see them everywhere, and you'll learn how they provide easy access to the service container keeping your code succint,readable and testable in the same time

另一个特殊的功能是Facades:(不要与同音异义设计模式混淆)你会在任何地方看到它们,并且你将学习它们如何提供对服务容器的轻松访问,同时保持你的代码简洁、可读和可测试时间