PHP Laravel框架入门心得 | How to study PHP Laravel Framework
PHP有不少开发框架,其中比较出名的有Symfony和Laravel。
我说说我最近入门Laravel的感受和学习方法吧。
1。第一个感受是Laravel的社区讨论和学习资源真的是太棒了,中文化也做得很好。最令人印象深刻的是下面这个学习资源
https://laracasts.com/
里面很多Laravel的视频教程,我学的是这个
https://laracasts.com/series/laravel-from-scratch-2017
不仅能学到PHP Laravel的知识,而且能学到他的编程风格,好的编程习惯等等。
另外一个是laravel china的中文社区
https://laravel-china.org/
我看到不少好资料,其中
http://laravel-china.github.io/php-the-right-way/
这个很全面的介绍了PHP的入门和编程规范,特别好。
2。Laravel本身也是一种MVC框架,model,view,controller。它的内在流程是这样,一个HTTP REQUEST从客户段浏览器进来之后,由laravel的ROUTE来接收,ROUTE可以绑定一个Controller的方法,由这个方法来处理进来的这个HTTP REQUEST。在Controller的方法中,可以引进Model,就是核心的业务实现了,Model是通过Migration跟DB连接的,可以通过对Model对象的操作,实现对数据库的操作。最后Model对象操作完了之后,把结果传给View,View会绑定一个PHP,实现前端页面的显示。
这是Laravel最基本的结构,在此基础上可以实现更多复杂的功能。
----------------------------------------------------------------------------------------------------------------------------------------------------
English Version
----------------------------------------------------------------------------------------------------------------------------------------------------------
There are many PHP frameworks, representative ones are Symfony and Laravel.
As I learned Laravel Recently, I'd like to share my experience.
1. The first impression of Laravel is that the learning community is excellent, in which it provides tremendous resources to help people study and master the framework. I like to watch video tutorial to study new knowledge, so laracasts is my favorite.
https://laracasts.com/
There are many video tutorials, what I followed is as below
https://laracasts.com/series/laravel-from-scratch-2017
Not only I can learn PHP Laravel gramar, but only I can follow the video teacher's good programming style and preference and so on.
2. Secondly, let me briefly introduce Laravel framework structure. Laravel framework follows MVC desagn pattern, Model, View, Controller. It works like below
One HTTP Request is send by client browser and it be handled by Laravel Route. Route will bind a method function of Controller, in which the method will take over the HTTP Request, meanwhile Model instances are declared at the method. The Model is connected with DB through Migration object. We can manipulate the DB by directly alter Model instance. The core business logic is implementd at controller method. Finally the output of the method will pass to View, which is the frontend presentation layer.
PHP Laravel框架入门心得 | How to study PHP Laravel Framework的更多相关文章
- php的laravel框架使用心得
最近在做一项目,是基于laravel的后台api,用于与手机交互的,数据采用json格式.下面说下怎样在两周内把一个新框架或者语言用的得心应手. 项目采用laravel5.4+dingoapi+jwt ...
- laravel框架入门
本文摘自网络,个人感觉写的很不错,决定收藏一下纯属本人学习之用 本文介绍如何开始使用 Laravel. 读完本文,你将学到: 如何安装 Laravel,新建 Laravel 程序,如何连接数据库: L ...
- laravel教程入门笔记
安装laravel框架 1.安装命令 composer create-project --prefer-dist laravel/laravel ytkah ytkah表示文件夹名,如果不写的话自动会 ...
- 使用 Composer 安装 Laravel 框架
前言: 1. Composer 安装 Laravel 有两种方式: 第一种是通过 Composer 的 create-project 命令安装 Laravel 框架, 第二种是先通过 Composer ...
- 关于Laravel框架
第1讲-Laravel介绍 1.1 什么是Laravel laravel是目前一个比较主流的框架,现在很多互联网的公司都在使用该框架.该框架的前身是symfony框架 Laravel的定位就是做一个简 ...
- Laravel开发:Laravel框架门面Facade源码分析
前言 这篇文章我们开始讲 laravel 框架中的门面 Facade,什么是门面呢?官方文档: Facades(读音:/fəˈsäd/ )为应用程序的服务容器中可用的类提供了一个「静态」接口.Lara ...
- laravel框架基础(1)---入门与介绍
1.安装laravel5.7 (composer )2018-12-28 11:59:02 [作者:struggler] Php的版本要求:php>=7.1.3 打开php OpenSSL扩展 ...
- vue框架入门和ES6介绍
vue框架入门和ES6介绍 vue-mvvm模式,vue是一种轻量级的前端框架,主要为模板渲染,数据同步,组件化,模块化,路由等. https://cn.vuejs.org/ 源码:https://g ...
- AngularJS入门心得2——何为双向数据绑定
前言:谁说Test工作比较轻松,最近在熟悉几个case,差点没疯.最近又是断断续续的看我的AngularJS,总觉得自己还是没有入门,可能是自己欠前端的东西太多了,看不了几行代码就有几个常用函数不熟悉 ...
随机推荐
- PHP截取日期
date( 'Y-m-d ',strtotime('2017-10-9 12:23:35')) 通过时间格式,获取的是2017-10-9
- python性能分析--cProfile
Python标准库中提供了三种用来分析程序性能的模块,分别是cProfile, profile和hotshot,另外还有一个辅助模块stats.这些模块提供了对Python程序的确定性分析功能,同时也 ...
- 分布式系统之消息中间件rabbitmq
分布式系统之消息中间件rabbitmq 博客分类: 感谢: 一般php 用rabbitmq java 用activemq http://spartan1.iteye.com/blog/11802 ...
- gradle入门(1-8)gradle 的依赖查看、依赖排除和指定版本(需要验证!)
一.依赖查看 gradle dependencies 在gradle dependencies输出会有如下几种标记: 1.版本 : 唯一的依赖. 2.版本():还存在该库其他版本的依赖或者间接依赖,并 ...
- 启动mongodb遇到的错:warning: 32-bit servers don't have journaling enabled by deflity
执行修复:mongod --repair即可 正常关闭:killall mongod
- JS笔记(一)
第一章: 编写JS流程: 1. 布局:HTML和CSS 2. 样式:修改页面元素样式,div的display样式 3. 事件:确定用户做什么操作,onclick(鼠标点击事件).onmouseo ...
- python开发:python基本数据类型
运算符 1.算数运算: 2.比较运算: 3.赋值运算: 4.逻辑运算: 5.成员运算: 基本数据类型 1.数字 int(整型) 在32位机器上,整数的位数为32位,取值范围为-2**31-2**31- ...
- 文本处理三剑客之sed
sed 1.简介 sed是一种流编辑器,它一次处理一行内容.处理时,把当前处理的行存储在临时缓冲区中,称为"模式空间"(patternspace),接着用sed命令处理缓冲区中的内 ...
- Python系列之 - 反射
一.静态方法(staticmethod)和类方法(classmethod) 类方法:有个默认参数cls,并且可以直接用类名去调用,可以与类属性交互(也就是可以使用类属性) 静态方法:让类里的方法直接被 ...
- 01、NetCore2.0优化之Web服务器 与 IIS解耦
01.NetCore2.0优化之Web服务器 与 IIS解耦 在Asp.Net Core 2.0中,是如何实现跨平台的?不使用IIS了,在linux上的WebServer是什么? ---------- ...