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,总觉得自己还是没有入门,可能是自己欠前端的东西太多了,看不了几行代码就有几个常用函数不熟悉 ...
随机推荐
- 洛谷P2894 [USACO08FEB]酒店Hotel
P2894 [USACO08FEB]酒店Hotel https://www.luogu.org/problem/show?pid=2894 题目描述 The cows are journeying n ...
- lamp环境搭建经验总结
环境:centos6.4,13个源码包:参考教程高罗峰细说php思路:1.首先确定gcc,g++的安装,因为这是c语言的编译工具,没有它,源码不可能安装,redhat的yum需要配置,分为本地源和网络 ...
- ORA-00379 缓冲池 DEFAULT 中无法提供 32K 块大小的空闲缓冲区
(一)问题 今天在使用Pl/sql developer查看表空间大小的时候,报错误:ORA-00379 缓冲池 DEFAULT 中无法提供 32K 块大小的空闲缓冲区,具体如下图: SQL> s ...
- vueJs 源码解析 (三) 具体代码
vueJs 源码解析 (三) 具体代码 在之前的文章中提到了 vuejs 源码中的 架构部分,以及 谈论到了 vue 源码三要素 vm.compiler.watcher 这三要素,那么今天我们就从这三 ...
- zuul入门(3)开发zuul的过滤器
1.编写Zuul过滤器(Java&Groovy) 理解过滤器类型和请求生命周期后,我们来编写一个Zuul过滤器.编写Zuul的过滤器非常简单,我们只需继承抽象类ZuulFilter,然后实现几 ...
- SpringBoot 分布式session
SpringBoot 分布式session实现 1. 什么是分布式session 在集群环境中,不得不考虑的一个问题是用户访问产生的session如何处理.如过不做任何处理,用户将出现频繁俸禄的现象, ...
- bugfree,CDbConnection 无法开启数据库连线: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.0.99' (4)
安装bugfree后,访问报错:CDbConnection 无法开启数据库连线: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '19 ...
- Python之线程
操作系统线程理论 线程概念的引入背景 进程 之前我们已经了解了操作系统中进程的概念,程序并不能单独运行,只有将程序装载到内存中,系统为它分配资源才能运行,而这种执行的程序就称之为进程.程序和进程的区别 ...
- Python基础--函数的定义和调用
一.函数的作用: 提高代码的可读性,减少代码的冗余,方便调用和修改,组织结构清晰 二.函数的定义:函数遵循先定义后调用的原则 1.无参函数 def funcname(): #def 是关键字,后跟函数 ...
- Django:(博客系统)添加文章(中文)出现UnicodeEncodeError乱码
添加文章时出现了一个UnicodeEncodeError乱码问题 在添加文章时,抛出了异常: 解决方案,修改manage.py(添加import sys reload(sys) sys.setdefa ...