laravel 5 yii 2
play

Laravel 5 & Yii 2 A look into two popular PHP frameworks Connor - PowerPoint PPT Presentation

Laravel 5 & Yii 2 A look into two popular PHP frameworks Connor Tumbleson https://github.com/iBotPeaches Developer (SourceToad) Built Applications in CodeIgniter Laravel 4.2 Laravel 5 Who am I? Laravel 5.1


  1. Laravel 5 & Yii 2 A look into two popular PHP frameworks

  2. • Connor Tumbleson • https://github.com/iBotPeaches • Developer (SourceToad) 
 • Built Applications in • CodeIgniter • Laravel 4.2 • Laravel 5 Who am I? • Laravel 5.1 • Yii 2

  3. Plan • Framework Popularity • History • Setup & Configuration • Environments • Controllers & Routes • Active Record • Views & Widgets • Modules & Packages • Code Generation • Community • Versioning

  4. Framework Popularity - History

  5. Framework Popularity - 7 day

  6. Framework Popularity - Multiple Frameworks

  7. Laravel - The PHP Framework for Web Artisans • Started in June 2011 • 1.0 Released August 2011 • Laravel 4 included Composer in May 2013 • Started by: Taylor Otwell • Previously: CodeIgniter (used, not team) • Last Release: v5.2.20 (2/19/2016) • as of 2/22/2016

  8. Yii - A high-performance PHP framework best for developing Web 2.0 applications • Started in October 2006 • 1.0 Release December 2008 • Yii2 included Composer in October 2014 • Started by: Qiang Xue • Previously: Prado (dev) • Last Release: v2.0.7 (2/14/2016)

  9. Yii is pronounced as Yee, and is an acronym for "Yes It Is!" This is often the accurate, and most concise response to inquires from those new to Yii: Is it fast? ... Is it secure? ... Is it professional? ... Is it right for my next project? ... Yes, it is!

  10. Setup Both install via 1-2 lines with composer composer is PHP’s answer to package managers. - matching Ruby’s bundler & Node’s npm composer create-project --prefer-dist laravel/laravel blog composer global require "fxp/composer-asset-plugin:~1.1.1" composer create-project --prefer-dist yiisoft/yii2-app-basic basic

  11. Configuration • Laravel • Highly commented and separated files • Priority to dotenv (environment separation) • Lots of files (12 on stock) • Yii • Chained loading of configuration files • Multi depth arrays (5+) • Mixed logic • Small amount of configuration files

  12. slide title

  13. Environments • Laravel • Loads environment variables into $_ENV and $ _SERVER • .env file out of repository • Yii • Logic in configuration files, in addition to bootstrap files • YII_ENV_DEV for enabling debug features • Can get complicated with multiple environments

  14. slide title

  15. Controllers & Routes • Laravel • Resource Controllers, Implicit Controllers • Route Grouping, Name spacing • Model binding • Yii • Controller mapping, 3rd party modules • Actions - errors, views, etc • Enforced moduleId/controllerId/actionId structure

  16. slide title

  17. Active Record • Both • Relations, events (Creating, Saving, Deleting) • Validation • Laravel • JSON Castable • Built in Soft Delete • Yii • Scenarios

  18. Views • Both • Layouts, Partials • Yii • Blocks • Meta Injection • View Events • Laravel • Blade Template Engine • Sections

  19. slide title

  20. Widgets • Yii • DetailedView, ListView, GridView • PJAX • ActiveForm, Field • Bootstrap/Regular • Very powerful • Laravel • Moved to LaravelCollective (out of core) • ActiveForm, Field

  21. Widgets - Laravel • Laravel Collective • Contains old functionality • ActiveForm • 3rd party • Alternatives? • View Composers/Creators • Extend Blade

  22. Widgets - Yii • Very powerful widgets • Listing data • Sorting/Searching data • Displaying data • Tons of options • Not all documented • Asset Bundle • Inserting js/css as needed

  23. Modules & Packages • Yii • Laravel • Advanced / Basic template • Socialite • AuthClient • Cashier • Twig • Envoy • Debug • Spark • mongoDB / elastic search • Lumen

  24. Boilerplate & Code Generation • Yii • Gii • CRUD, Models, Controller • Extensions, Forms, Modules • Enforce pattern • GUI and CLI • Laravel • artisan make • most stubs for file placement • No GUI

  25. Code Generation - Yii http://meetup.yii/ Quick little demo using Gii ( meetup_admin / meetup )

  26. Community - Laravel • Laracasts • Jeffrey Way • Graham Campbell • Homestead - Vagrant • Forge - Provision • Envoyer - Deployments

  27. Community - Yii • Yii Website • Yii2Tech • Yii2 Cookbook • Outdated, mix of 1.1 / 2.0 • Diverse Dev Team

  28. Versioning - Laravel • Lots of patch updates • v4.x - 60 patch updates • 1 year 9 months • v5.0 - 35 patch updates • 4 months • v5.1 - 30 patch updates • 6 months - LTS • v5.2 - 17 patch updates • current

  29. Versioning - Yii • Supported long term • Moderate patch updates • Releases every few months • v1.0 - 12 patch updates • 1 year 10 months • v1.1 - 16 patch updates • 4 years 9 months • v2.0 - 7 patch updates • current

  30. Conclusion - Laravel • Semantic Sugar • Large Community • Lessons via Laracasts • Quick Updates • Requires PHP >= 5.5.9 • A few needed extensions (mb, pdo, openssl) • Freedom to organize, design on own

  31. Conclusion - Yii • Built to last • Enforced, but extendable format • Mixed plugins/documentation • PHP >= 5.4.0 • Hard to test / mock • Helpful standard to ease multi person projects

  32. sourcetoad.com info@sourcetoad.com 813.964.7349

More recommend