SlideShare a Scribd company logo
Drupal8 for Symfony
Developers
Antonio Perić-Mažar

17.02.2017 @ #phpuk
@antonioperic
About me
• Antonio Perić-Mažar, mag. ing. comp.
• CEO, Co-Founder @ Locastic
• Co-Founder @ Shift Conference
• Software developer, Symfony2
• Open Source Contributor
• SFUGCRO

• www.locastic.com
• antonio@locastic.com
• @antonioperic
@antonioperic
Locastic
• We help clients create amazing web and mobile apps (since 2011)
• design and development agency
• mobile development
• web development
• UX/UI
• Training and Consulting
• Shift Conference, Symfony Croatia
• www.locastic.com
• @locastic
@antonioperic
Inside Locastic
@antonioperic
Almost 25% of our
team are women
@antonioperic
Questions?
• Any Drupal experts/developers here?
• Symfony developers?
• Symfony developers without Drupal knowledge
@antonioperic
Drupal 101 for SF
developers
@antonioperic
Before we start, small
disclaimer
@antonioperic
My world is Symfony (still)
@antonioperic
♥
@antonioperic
@antonioperic
What this means
• Drupal8 doesn’t use full stack Symfony, it uses components (maybe in future)
• Moving Drupal to modern stack
• Building powerful CMS on top of Symfony components
• Connecting two big communities
• More learning for Drupal developers (OOP, Symfony, new concepts)
Drupal8 for Symfony Developers
@antonioperic
Who is it for?
• Content strategist
• Site Administrators
• Content editors
• “Build stuff without writing code”
• Professional developers
• Bespoke applications
• “Make writing code easier”
@antonioperic
In Drupal 8 there's three different types of
knowledge that you're going to be using in
order to work with it effectively.
@antonioperic
@antonioperic
@antonioperic
@antonioperic
@antonioperic
Symfony2
Framework
Bundle
Symfony2
Bundles
Symfony2
CMF Bundles
Symfony2
Components
Partnered Libs
(twig, etc.)
CMF
Components
Symfony fullstack Drupal 8
Distribution
Drupal Core
Modules
Drupal Contrib
Modules
Drupal Core Libraries
Symfony2
Components
Partnered Libs
(twig, etc.)
Drupal
Components
@antonioperic
Symfony Components
• ClassLoader
• Console
• CssSelector
• DependencyInjection
• EventDispatcher
• HttpFoundation
• HttpKernel
• Process
• Routing
• Serializer
• Translation
• Validator
• Yaml
@antonioperic
• HTTP Kernel
• Request / Response
• Controllers
• Event Dispatching
• Listeners / Subscribers
Dependencyinjectioncontainer
@antonioperic
Development environment
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Or just use your Symfony
development environment
• PHP built-in server
• Vagrant
• Docker
• …
@antonioperic
Tools
@antonioperic
Drush
• update core and contrib
• download modules
• enable modules
• clear cache
• update db
• run cron
• import config
• export config
• create user
• change password
• one time login
• backup drupal
• restore drupal
• compile twig templates
*Type “drush” to get full list - www.drushcommands.com
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Drupal Console
• update core and contrib
• download modules
• enable modules
• clear cache
• update db
• run cron
• import config
• export config
• generate console command
• generate entity
• generate content type
• generate modules
• run unit test
*Type “drupal list” to get full list - drupalconsole.com/docs
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Installation
@antonioperic
How to install Drupal8
• Drush
• drush dl drupal
• Composer
• Download zip file
@antonioperic
Lets use composer
• drupal/drupal.
• This uses Drupal itself as a template for the new site. It is the simplest
solution but lacks additional configuration that can be helpful.



• drupal-composer/drupal-project.
• This open source project acts as a kickstarter for Composer-based Drupal
sites. It provides default configuration that otherwise needs to be added
manually.
@antonioperic
Let’s use composer
@antonioperic
Let’s use composer
composer create-project drupal/drupal
Drupal8 for Symfony Developers
@antonioperic
Let’s use composer
composer require drupal/<modulename>
for example:
composer require drupal/token
@antonioperic
Run in browser
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Add some content
Drupal8 for Symfony Developers
drupal create:nodes
Drupal8 for Symfony Developers
@antonioperic
We have content but
something is missing
Drupal8 for Symfony Developers
@antonioperic
WebProfiler
@antonioperic
composer require drupal/devel
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Under the Hood
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Request -> Response
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Pipeline
1. After the controller returned a render array, the VIEW will be triggered by the HttpKernel, because
the controller result is not a Response, but a render array.
2. MainContentViewSubscriber is subscribed to the VIEW event. It checks whether the controller
result is an array, and if so, it guarantees to generate a Response.
3. Next, MainContentViewSubscriber checks whether the negotiated request format is supported:
1. Any format for which a main content renderer service exists (an implementation of
MainContentRendererInterface is supported.
2. If the negotiated request format is not supported, a 406 JSON response is generated, which lists
the supported formats in a machine-readable way (as per RFC 2616, section 10.4.7).
4. Otherwise, when the negotiated request format is supported, the corresponding main content
renderer service is initialized. A response is generated by calling
MainContentRendererInterface::renderResponse() on the service. That's it
@antonioperic
Main Content Renderes
HTML: HtmlRenderer (text/html)
AJAX: AjaxRenderer (application/vnd.drupal-ajax)
Dialog: DialogRenderer (application/vnd.drupal-dialog)
Modal: ModalRenderer (application/vnd.drupal-modal)
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Routing
Drupal8 for Symfony Developers
@antonioperic
Controllers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Services
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Events / Listeners
@antonioperic
@antonioperic
Registering event subscribers
Here are the steps to register an event subscriber:
Define a service in your module, tagged with 'event_subscriber' (see the Services topic for instructions).
Define a class for your subscriber service that implements SymfonyComponentEventDispatcherEventSubscriberInterface
In your class, the getSubscribedEvents method returns a list of the events this class is subscribed to, and which methods on the class
should be called for each one. Example:
public static function getSubscribedEvents() {
// Subscribe to kernel terminate with priority 100.
$events[KernelEvents::TERMINATE][] = array('onTerminate', 100);
// Subscribe to kernel request with default priority of 0.
$events[KernelEvents::REQUEST][] = array('onRequest');
return $events;
}
@antonioperic
Building Custom Module

HelloPHPUK
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
Drupal8 for Symfony Developers
@antonioperic
Recap
• Symfony components are main building tool for D8
• DIC is backbone of Drupal
• DI for controllers is very easy
• Events are replacing hooks
• Building custom module is easy
• Hardest thing is to start
• This is just beginning there is a lot to learn about and from D8
@antonioperic
Thank you!
antonio@locastic.com
@antonioperic
www.locastic.com

More Related Content

PPTX
Engage 2019 Software documentation is fun if you have the right tools: Introd...
PPTX
Migration from ASP.NET MVC to ASP.NET Core
PPTX
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
PPTX
Introduction to PowerShell at Chicago Code Camp 2014
PDF
The XPages Mobile Controls: What's New in Notes 9.0.1
PDF
Use the PnP SharePoint Starter Kit to create your intranet in a box
PDF
Jenkins JobDSL - Configuration as code
PDF
Beyond Domino Designer
Engage 2019 Software documentation is fun if you have the right tools: Introd...
Migration from ASP.NET MVC to ASP.NET Core
Tarabica 2019 - Migration from ASP.NET MVC to ASP.NET Core
Introduction to PowerShell at Chicago Code Camp 2014
The XPages Mobile Controls: What's New in Notes 9.0.1
Use the PnP SharePoint Starter Kit to create your intranet in a box
Jenkins JobDSL - Configuration as code
Beyond Domino Designer

What's hot (20)

PDF
OpenNTF Webinar, March, 2021
PPTX
DevNet 1056 WIT Spark API and Chat Bot Workshop
PPTX
A brave new world – mac os x, power shell and linux
PPTX
Azure Functions
PPTX
C#: Past, Present and Future
PDF
Automating everything with Microsoft Flow
PDF
2013 t-dose - libre office easyhacks
PDF
All about SPFx
PPTX
Revolutionize Your Workflow with ChatOps
PDF
Getting started with mobile application development
PPTX
Introduction to SharePoint Framework (SPFx)
PPTX
Cross Platform Mobile App Development
PDF
All about Office UI Fabric
PPT
Extending Piwik At R7.com
PPTX
A Tasty deep-dive into Open API Specification Links
PPTX
Building Chatbots
PDF
Reach the next level with PowerShell
PPTX
The Greatest Introduction to SharePoint Framework (SPFx) on earth!
PDF
July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!
PPTX
Workshops from konferencjabeit.pl
OpenNTF Webinar, March, 2021
DevNet 1056 WIT Spark API and Chat Bot Workshop
A brave new world – mac os x, power shell and linux
Azure Functions
C#: Past, Present and Future
Automating everything with Microsoft Flow
2013 t-dose - libre office easyhacks
All about SPFx
Revolutionize Your Workflow with ChatOps
Getting started with mobile application development
Introduction to SharePoint Framework (SPFx)
Cross Platform Mobile App Development
All about Office UI Fabric
Extending Piwik At R7.com
A Tasty deep-dive into Open API Specification Links
Building Chatbots
Reach the next level with PowerShell
The Greatest Introduction to SharePoint Framework (SPFx) on earth!
July 2020 OpenNTF Webinar - Hear the Latest from the User Groups!
Workshops from konferencjabeit.pl
Ad

Viewers also liked (20)

PPTX
Debugging Effectively - PHP UK 2017
PDF
JWT - To authentication and beyond!
PDF
Hopping in clouds - phpuk 17
PDF
Demystifying Object-Oriented Programming - PHP UK Conference 2017
PDF
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
PDF
Integrating React.js with PHP projects
PDF
Preparing your dockerised application for production deployment
PDF
Driving Design through Examples
PDF
Building real time applications with Symfony2
PDF
Symfony in the Cloud
PDF
Sympal A Cmf Based On Symfony
PPTX
міський проект «щаслива лапка»
PDF
Symfony und Ember.js auf einer Seite #codetalks14
PPT
Building Single Page Application (SPA) with Symfony2 and AngularJS
PDF
Matters of State
PPTX
How the real-time communication between things can simplify our everyday lif...
PDF
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
PPTX
Serverless Architecture
PDF
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
PDF
PHP UK 2017 - Don't Lose Sleep - Secure Your REST
Debugging Effectively - PHP UK 2017
JWT - To authentication and beyond!
Hopping in clouds - phpuk 17
Demystifying Object-Oriented Programming - PHP UK Conference 2017
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Integrating React.js with PHP projects
Preparing your dockerised application for production deployment
Driving Design through Examples
Building real time applications with Symfony2
Symfony in the Cloud
Sympal A Cmf Based On Symfony
міський проект «щаслива лапка»
Symfony und Ember.js auf einer Seite #codetalks14
Building Single Page Application (SPA) with Symfony2 and AngularJS
Matters of State
How the real-time communication between things can simplify our everyday lif...
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Serverless Architecture
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
PHP UK 2017 - Don't Lose Sleep - Secure Your REST
Ad

Similar to Drupal8 for Symfony Developers (20)

PDF
Drupal8 for Symfony developers - Dutch PHP
PDF
Drupal8 for Symfony Developers (PHP Day Verona 2017)
PDF
Symfony4 - A new way of developing web applications
PDF
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
PDF
Desktop Apps with PHP and Titanium
PPTX
An introduction to the office devpnp community initiative
PPTX
Neev Open Source Contributions
PPTX
They why behind php frameworks
PPTX
Dd13.2013.milano.open ntf
PDF
Symfony4: A new way to develop applications | Antonio Peric | CODEiD
PDF
Building and deploying PHP applications with Phing
PPTX
Webinar on How to use MyAppConverter
PPTX
Domain Specific Development using T4
PPTX
(WPF + WinForms) * .NET Core = Modern Desktop
PPTX
Create a copy of your SharePoint farm with SPDocKit and AutoSPInstaller
PPT
.NET Recommended Resources
PDF
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
PPTX
Automation in Drupal
PPTX
Free Mongo on OpenShift
PPTX
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack
Drupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Symfony4 - A new way of developing web applications
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Desktop Apps with PHP and Titanium
An introduction to the office devpnp community initiative
Neev Open Source Contributions
They why behind php frameworks
Dd13.2013.milano.open ntf
Symfony4: A new way to develop applications | Antonio Peric | CODEiD
Building and deploying PHP applications with Phing
Webinar on How to use MyAppConverter
Domain Specific Development using T4
(WPF + WinForms) * .NET Core = Modern Desktop
Create a copy of your SharePoint farm with SPDocKit and AutoSPInstaller
.NET Recommended Resources
The Latest and Greatest from OpenNTF and the IBM Social Business Toolkit, #dd13
Automation in Drupal
Free Mongo on OpenShift
Scaling Your App With Docker Swarm using Terraform, Packer on Openstack

More from Antonio Peric-Mazar (20)

PDF
You call yourself a Senior Developer?
PDF
Using API Platform to build ticketing system #symfonycon
PDF
Using API platform to build ticketing system (translations, time zones, ...) ...
PDF
Are you failing at being agile? #digitallabin
PDF
Symfony 4: A new way to develop applications #ipc19
PDF
A year with progressive web apps! #webinale
PDF
The UI is the THE application #dpc19
PDF
Symfony 4: A new way to develop applications #phpsrb
PDF
REST easy with API Platform
PDF
A year with progressive web apps! #DevConMU
PDF
Service workers are your best friends
PDF
Progressive Web Apps are here!
PDF
Building APIs in an easy way using API Platform
PDF
Build your business on top of Open Source
PDF
Building APIs in an easy way using API Platform
PDF
Lessons learned while developing with Sylius
PDF
Maintainable + Extensible = Clean ... yes, Code!
PDF
A recipe for effective leadership
PPT
Sylius ecommerce solution for Symfony2 (WebCamp Ljubljana)
PPT
Symfony2 and AngularJS
You call yourself a Senior Developer?
Using API Platform to build ticketing system #symfonycon
Using API platform to build ticketing system (translations, time zones, ...) ...
Are you failing at being agile? #digitallabin
Symfony 4: A new way to develop applications #ipc19
A year with progressive web apps! #webinale
The UI is the THE application #dpc19
Symfony 4: A new way to develop applications #phpsrb
REST easy with API Platform
A year with progressive web apps! #DevConMU
Service workers are your best friends
Progressive Web Apps are here!
Building APIs in an easy way using API Platform
Build your business on top of Open Source
Building APIs in an easy way using API Platform
Lessons learned while developing with Sylius
Maintainable + Extensible = Clean ... yes, Code!
A recipe for effective leadership
Sylius ecommerce solution for Symfony2 (WebCamp Ljubljana)
Symfony2 and AngularJS

Recently uploaded (20)

PDF
Digital Strategies for Manufacturing Companies
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Nekopoi APK 2025 free lastest update
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Introduction to Artificial Intelligence
PDF
AI in Product Development-omnex systems
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Nekopoi APK 2025 free lastest update
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Introduction to Artificial Intelligence
AI in Product Development-omnex systems
Upgrade and Innovation Strategies for SAP ERP Customers
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms I-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How to Choose the Right IT Partner for Your Business in Malaysia

Drupal8 for Symfony Developers