Save 37% off PRO during our Black Friday Sale! »

Symfony 4 Run-through

Symfony 4 Run-through

Symfony is a framework broadly recognized for its quality, reliability and ability to drive large enterprise projects. But for the last few years, Symfony has also gained many features to develop faster, and to refactor more easily. Symfony 4 offers major improvements in this area that will deeply change the way we build applications.

Let's talk about:

* Symfony 4 main concepts and new features: micro-framework by default, 12-factor app, new components ...
* Flex, the new and powerful Symfony installer that can also automatically install and configure libraries and bundles
* Symfony 4's new simplified (and "bundle-less") directory structure
* The autowiring (now enabled by default), which allows the automatic injection of dependencies without having to write any configuration (no more YAML and XML)
* The revamped controllers mechanism
* Webpack Encore, the first Symfony component ever written in JavaScript, designed to easily integrate JavaScript and CSS tools in a PHP project
* The official integrations of the Doctrine (ORM), API Platform (API) and EasyAdmin libraries (admin generator)
* How to easily use Symfony 4 with Docker from dev to cloud deployment with a dedicated skeleton

You'll learn how to leverage Symfony for large projects, prototypes, small applications and even your "weekend projects", and how to migrate from smallest to the largest.

E66449b8260b07a1cf51c5ab5eaa8180?s=128

Kévin Dunglas

October 26, 2017
Tweet

Transcript

  1. Les-Tilleuls.coop Symfony 4 Run-through

  2. Les-Tilleuls.coop Kévin Dunglas ❏ ❏ ❏ @dunglas

  3. Les-Tilleuls.coop Self-managed ⬆ ➡ Les-Tilleuls.coop

  4. Les-Tilleuls.coop factory.football ⚽

  5. Les-Tilleuls.coop

  6. Les-Tilleuls.coop

  7. Les-Tilleuls.coop Symfony 4 ⏰

  8. Les-Tilleuls.coop hAmZAP

  9. Les-Tilleuls.coop Symfony 3.4 and 4.0 3.4 ❏ ❏ ❏ ❏

    4.0 ❏ ❏ ❏ ❏
  10. Les-Tilleuls.coop Install

  11. Les-Tilleuls.coop Install Symfony 4 composer create-project \ -s beta \

    # Default to Symfony 3 otherwise symfony/skeleton factory.football
  12. Les-Tilleuls.coop

  13. Les-Tilleuls.coop

  14. Les-Tilleuls.coop The Symfony Skeleton ❏ composer.json ❏ ❏ ❏ ❏

  15. Les-Tilleuls.coop

  16. Les-Tilleuls.coop

  17. Les-Tilleuls.coop Structure

  18. Les-Tilleuls.coop

  19. Les-Tilleuls.coop New structure ❏ ❏ App\ ❏ index.php app*.php ❏

    ❏ ❏ .env parameter.yml ❏
  20. Les-Tilleuls.coop Microframework means microkernel!

  21. Les-Tilleuls.coop Symfony Flex

  22. Les-Tilleuls.coop Symfony Flex ❏ ❏ ❏ ❏ ❏

  23. Les-Tilleuls.coop Flex Recipes ❏ ❏ ❏ ❏ symfony/recipes ❏ symfony/recipes-contrib

  24. Les-Tilleuls.coop

  25. Les-Tilleuls.coop Example: Installing Twig

  26. Les-Tilleuls.coop

  27. Les-Tilleuls.coop

  28. Les-Tilleuls.coop

  29. Les-Tilleuls.coop More packages composer req \ serializer annotation orm

  30. Les-Tilleuls.coop

  31. Les-Tilleuls.coop DI and controllers

  32. Les-Tilleuls.coop 0 config ❏ ➡ No more service config! ❏

    ❏ ❏ ❏ ➡
  33. Les-Tilleuls.coop Designed by @nicolasgrekas and me during last year #ForumPHP’s

    community drink
  34. Les-Tilleuls.coop All you need is here A real-life controller

  35. Les-Tilleuls.coop Automatic dependency injection ❏ ❏ ❏

  36. Les-Tilleuls.coop Action injection

  37. Les-Tilleuls.coop Symfony 2 style

  38. Les-Tilleuls.coop Much more to say! ❏ ❏ ❏ ❏ ➡

    ❏ App\Foo: {$arg: hello} ❏ ❏
  39. Les-Tilleuls.coop You want more?

  40. Les-Tilleuls.coop Cloud Native ☁

  41. Les-Tilleuls.coop 12-factor app and env vars ❏ ❏ .env ❏

    ❏ ❏ parameters.yml
  42. Les-Tilleuls.coop Minimalist logger ❏ ❏ ❏ ❏

  43. Les-Tilleuls.coop

  44. Les-Tilleuls.coop Various improvements ❏ ❏ ❏

  45. Les-Tilleuls.coop

  46. Les-Tilleuls.coop Docker support

  47. Les-Tilleuls.coop Docker support docker-compose up

  48. Les-Tilleuls.coop

  49. Les-Tilleuls.coop Docker support ❏ ❏ ❏ ❏ ❏ ❏

  50. Les-Tilleuls.coop Symfony Encore

  51. Les-Tilleuls.coop Webpack Encore ❏ ❏ ❏ ❏ ❏

  52. Les-Tilleuls.coop Install composer req encore # Use Flex (not mandatory)

    yarn install # Alternatively: npm install
  53. Les-Tilleuls.coop Easy configuration

  54. Les-Tilleuls.coop For legacy apps...

  55. Les-Tilleuls.coop Build # Dev (not minified) ./node_modules/.bin/encore env # Production

    (minified) ./node_modules/.bin/encore production
  56. Les-Tilleuls.coop Include assets in the template

  57. Les-Tilleuls.coop H2 Push & hints ⚡

  58. Les-Tilleuls.coop Specifications W3C’s Preload ❏ ❏ W3C’s Resource Hints ❏

  59. Les-Tilleuls.coop Install and usage composer req weblink

  60. Les-Tilleuls.coop Result

  61. Les-Tilleuls.coop

  62. Les-Tilleuls.coop Official packages

  63. Les-Tilleuls.coop So you want an admin? composer req admin #

    Install EasyAdminBundle, by @javiereguiluz
  64. Les-Tilleuls.coop

  65. Les-Tilleuls.coop What about an hypermedia API? composer req api #

    Install API Platform, by your humble servant
  66. Les-Tilleuls.coop

  67. Les-Tilleuls.coop Yes, it supports GraphQL!

  68. Les-Tilleuls.coop joind.in/talk/2ac51 awards.symfony.com

  69. Les-Tilleuls.coop @dunglas @coopTilleuls