98
with your friend @weaverryan

with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

with your friend @weaverryan

Page 2: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

> Lead of the Symfony documentation team

> Writer for KnpUniversity.com

> Symfony fanboy/evangelist

> Husband of the much more talented @leannapelham

knpuniversity.com twitter.com/weaverryan

It’s-a me, Ryan!

> Father to my more handsome son, Beckett

Page 3: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

You have… a

superpower!

@weaverryan

Page 4: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

You know Drupal!

@weaverryan

Page 5: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

> Object-Oriented Principles

> Namespaces

> Routes & Controllers*

> Service Container*

> Events & Event Listeners*

> Drupal Console*

Drupal 8 leverages:

* come from Symfony components

Page 6: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Symfony

@weaverryan

Page 7: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

a collection of small PHP libraries

(the components)

@weaverryan

Symfony is…

Page 8: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

glue that makes these components work together

The Symfony Framework is…

Page 9: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

glue that makes these components work together

Drupal is…

???

Page 10: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Drupal=

Route & Controller System

Container

+

full of many services (objects) that do EVERYTHING & give all CMS features

@weaverryan

Page 11: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Symfony=

Route & Controller System

Container

+

full of almost zero services

@weaverryan

Page 12: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Imagine Drupal… where you uninstalled every single module

(including core)

@weaverryan

That’s Symfony

Page 13: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

… but you can install all the features you need.

Symfony is lean & mean…

Page 14: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Let’s code!

@weaverryan

Follow the code at: http://bit.ly/dcon18-symfony

Page 15: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer create-project symfony/skeleton dcon18

Page 16: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 17: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 18: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Page 19: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Hello Symfony Flex!

Page 20: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

15 files

No Database

Page 21: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Let’s start the built-in PHP web server

Page 22: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

http://localhost:8000/

Page 23: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Create an API Endpoint

@weaverryan

Page 24: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Step 1: Controller(i.e. function that builds the page)

<?php// src/Controller/SongController.php namespace App\Controller;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class SongController extends AbstractController{ public function apiWriteSong() { return $this->json([ 'I rode my truck, through some mud', ]); }}

Page 25: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

# config/routes.yamlsong_api_write_song: path: /api/songs controller: App\Controller\SongController::apiWriteSong

Step 2: Route(i.e. URL that points to the controller)

Page 26: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

* YES! No need to rebuild any cache!

@weaverryan

Page 27: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Your project is small

- service container

- routing system

- < 50 services

Page 28: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Your project is small

> no templating

> no database/ORM

> no logging

> no koopa troopas

Page 29: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Need something? Install it!

Drupal modules = Symfony bundles

@weaverryan

Page 30: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Install annotations support

@weaverryan

Page 31: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require annotations

Page 32: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

An alias (see symfony.sh)

Page 33: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 34: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Recipes

Page 35: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Step 1 (of 1):Controller & Route

<?php // src/Controller/SongController.php// ...class SongController extends AbstractController{ /** * @Route("/api/songs") */ public function apiWriteSong() { return $this->json([ 'I rode my truck, through some mud', ]); }}

Hey! Annotations! Like Drupal Plugins!

Page 36: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Let’s render a

template!

(Twig)

@weaverryan

Page 37: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require twig

Page 38: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 39: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

# config/packages/twig.yamltwig: paths: ['%kernel.project_dir%/templates']

Automated configurationTwig

templates/ directory created automatically

Page 40: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Create a new HTML page// src/Controller/SongController.php// ... /** * @Route("/another-song") */public function writeAnotherSong(){ $song = 'Back-road, boot-scooting, honkey-tonkin CMS'; return $this->render('song/anotherSong.html.twig', [ 'song' => $song, ]);}

{# templates/song/anotherSong.html.twig #}{% extends 'base.html.twig' %} {% block body %} <h1>{{ song }}</h1>{% endblock %}

Page 41: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 42: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Drupal Console?

Symfony has bin/console

Page 43: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console debug:twig

Page 44: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console debug:router

Page 45: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Better debugging

tools!

(e.g. devel for Symfony)

@weaverryan

Page 46: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require debug

Page 47: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 48: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 49: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 50: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

More bundles

means more services

(e.g. the “logger” service)

@weaverryan

Page 51: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

public function writeAnotherSong() { $logger = \Drupal::getContainer()->get('logger'); $logger->debug($song); // ... }

Fetching Services in Drupal

… or you can / should use dependency injection and update a services YML file

( the cheating way)

Page 52: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Fetching Services in Symfony

use Psr\Log\LoggerInterface; // ...

public function writeAnotherSong(LoggerInterface $logger) { $logger->debug($song); // ...}

Just ask for the service you need

Page 53: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console debug:autowiring

Page 54: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Organizing Code

// src/Service/SongGenerator.phpnamespace App\Service;class SongGenerator{ public function generateSong($noun) { $title = '...'; // magic song generator return $title; }}

Page 55: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Organizing Code

// src/Controller/SongController.phpuse App\Service\SongGenerator; // ... /** * @Route("/api/songs") */public function apiWriteSong(SongGenerator $songGenerator) { return $this->json([ $songGenerator->generateSong('truck'), ]);}

Page 56: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Let’s add a Database!

(doctrine)

@weaverryan

Page 57: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require doctrine

Page 58: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 59: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 60: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

# .env###> doctrine/doctrine-bundle ### # Configure other settings in config/packages/doctrine.yamlDATABASE_URL=mysql://root:[email protected]:3306/dcon2018_symfony ###< doctrine/doctrine-bundle ###

.env ≈ settings.php

php bin/console doctrine:database:create

(creates a db… but it’s empty for now)

Page 61: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require maker

php bin/console list make

Page 62: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan

Doctrine *also* has “entities”

one Entity class = one DB table

Page 63: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console make:entity

Page 64: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console make:entity

Page 65: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

// src/Entity/CountrySong.phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM; class CountrySong{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $title; // ... getTitle(), setTitle(), etc methods}

Page 66: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console make:migration

// src/Migrations/Version20180409012347.phpclass Version20180409012347 extends AbstractMigration{ public function up(Schema $schema) { $this->addSql('CREATE TABLE country_song (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); } public function down(Schema $schema) { // ... holds the opposite } }

Page 67: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console doctrine:migrations:migrate

Page 68: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Let’s create an API endpoint to save new

country songs

@weaverryan

Page 69: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

// src/Controller/SongController.php

use Doctrine\ORM\EntityManagerInterface;

/** * @Route("/api/songs", methods="POST") */public function apiWriteSong(SongGenerator $generator, EntityManagerInterface $em) { $song = new CountrySong(); $song->setTitle($generator->generateSong('truck')); $em->persist($song); $em->flush(); return $this->json([ 'title' => $song->getTitle(), 'id' => $song->getId(), ]);}

Page 70: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Hmm… creating the JSON was too much work

@weaverryan

Page 71: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

public function apiWriteSong(SongGenerator $gen, EntityManagerInterface $em) { $song = new CountrySong(); $song->setTitle($gen->generateSong('truck')); $em->persist($song); $em->flush(); return $this->json($song);}

does that work? …. noop

Page 72: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require serializerpublic function apiWriteSong(SongGenerator $gen, EntityManagerInterface $em) { $song = new CountrySong(); $song->setTitle($gen->generateSong('truck')); $em->persist($song); $em->flush(); return $this->json($song);}

Page 73: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

GET /api/songs/{id}

// src/Controller/SongController.php /** * @Route("/api/songs/{id}", methods="GET") */public function apiGetSong(CountrySong $song) { return $this->json($song);}

Page 74: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Let’s generate a

CRUD

@weaverryan

Page 75: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console make:crud

Page 76: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

php bin/console make:crud

Page 77: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 78: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Security

@weaverryan

Page 79: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require security-checker

Page 80: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

bin/console security:check

Flex will also give you a warning if you try to install a package with a known security vulnerability

Page 81: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 82: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Bonus: API Platform

@weaverryan

Page 83: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

// src/Entity/CountrySong.php// .../** * @ApiResource() * @ORM\Entity() */class CountrySong{ // ..}

composer require api

Page 84: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

Page 85: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 86: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 87: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham
Page 88: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

http://localhost:8000/country_songs.json

Page 89: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Bonus: Admin

Generator

@weaverryan

Page 90: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

composer require admin

# config/packages/easy_admin.yamleasy_admin: entities: # List the classes you want to manage - App\Entity\CountrySong

Page 91: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

@weaverryan@weaverryan

http://localhost:8000/admin

Page 92: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Bonus: Webpack Encore

@weaverryan

Page 93: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Drupal & Symfony

great, awkward, friends

@weaverryan

Page 94: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Drupal SymfonyRouting &

Controllers

Container

modules bundles

Console Tool bin/console

OOP, namespaces, Composer, etc

✅ (many services)

✅ (few services)

Plugins

Drupal Console

✅ ✅

Page 95: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Symfony Starts Tiny

> twig

> doctrine

> api

> logging

> cache

> debug

> … more at symfony.sh

… grows with you…

Page 96: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Have a project that doesn’t need a CMS?

Page 97: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Try Symfony!

(it’ll make you even better at Drupal anyways)

github.com/weaverryan/drupalcon18-symfony-for-drupalers

Page 98: with your friend @weaverryan · > Lead of the Symfony documentation team > Writer for KnpUniversity.com > Symfony fanboy/evangelist > Husband of the much more talented @leannapelham

Ryan Weaver @weaverryan

Free Symfony Video Tutorial: https://knpuniversity.com/tracks/symfony

THANK YOU DRUPALCON!