1 / 12

THE PHP FRAMEWORK FOR WEB ARTISANS

THE PHP FRAMEWORK FOR WEB ARTISANS. What is Laravel ?. Developed by Taylor Otwell Web application framework Follows MVC design pattern Expressive syntax. Why use Laravel. Elegant syntax Utilizes the latest PHP features Well documented CLI Tools Eloquent ORM Fun to develop with.

jun
Download Presentation

THE PHP FRAMEWORK FOR WEB ARTISANS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. THE PHP FRAMEWORK FOR WEB ARTISANS

  2. What is Laravel? • Developed by Taylor Otwell • Web application framework • Follows MVC design pattern • Expressive syntax

  3. Why use Laravel • Elegant syntax • Utilizes the latest PHP features • Well documented • CLI Tools • Eloquent ORM • Fun to develop with

  4. Closures • Introduced in PHP 5.3 • Anonymous functions Route::get(‘login’, function() { return View::make(‘users/login’); });

  5. The Syntactic Sugar • Easy to understand • Expressiveness and elegance Auth::check() Input::get() User::all()

  6. The MVC Layers • Eloquent ORM • Blade Engine • Controller

  7. Eloquent ORM • Easy to use class Feed extends Eloquent { public function user() { return $this->belongsTo('User'); } public function moment() { return $this->created_at->diffForHumans(); } }

  8. Eloquent ORM • Example queries: Book::all() Book::find(1) Book::where(‘name’, ‘=‘, ‘John Doe’) • Insert / Update $b = new Book(); $b->title = ‘Intro to Laravel’; $b->description = ‘This book rocks’; $b->save; $b = Book::find(2); $b->title = ‘Advanced Laravel’; $b->save();

  9. Eloquent ORM • Relationship mapping public function user() { return $this->belongsTo(‘Author’, ‘authro_id’); {

  10. Blade Engine • Stock templating engine for laravel • Supports template inheritance and sections <html> <head> <title>@yield('page_title')</title> </head> <body> Some text @yield('content') </body> </html>

  11. Blade Engine @extends(‘layout’) @section(‘page title’, ‘Test Page’) @section(‘content’) Hello user! @stop

  12. Bootstrap The most popular front-end framework for developing responsive, mobile first projects on the web.

More Related