SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
Drupal for Symfony Developers Samuel Solís - @estoyausenteSamuel Solís - @estoyausente
Drupal for Symfony
Developers
By Samuel Solís
Drupal for Symfony Developers Samuel Solís - @estoyausente
A PHP CMS
Samuel Solís - @estoyausente
¿What is Drupal?
Open
Source
Highly
customizable
Usually called
as CMF
Drupal for Symfony Developers Samuel Solís - @estoyausente
Main features
Security Performance
& Scaling
Multilingual Marketing
automation
Content
management Personalization
Content as a
Service
Drupal for Symfony Developers Samuel Solís - @estoyausente
A lot of contrib modules
Drupal for Symfony Developers Samuel Solís - @estoyausente
Note about Drupal versions
<D7 D7 D8
Old like a
mountain, now
unpredictable
Mature, important in
the Drupal story
Young, different, the
real hero
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal install
Usually LAMP environment but many variations possible.
1. Download the project https://github.com/drupal/recommended-project
2. Composer install
3. Install the database and configuration
a. Go to the site and follow the install wizard
b. Using drush with the command drush site-install
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal content structure
Drupal for Symfony Developers Samuel Solís - @estoyausente
Entity
Config
Entity
Content
Entity
Views
Languages
...
Node
Comment
...
Article
Basic Page
...
*.yml
Drupal for Symfony Developers Samuel Solís - @estoyausente
A config entity example: Views
Drupal for Symfony Developers Samuel Solís - @estoyausente
A content entity example: Nodes
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal UI tour
Drupal for Symfony Developers Samuel Solís - @estoyausente
Entity Types
Bulk operations
Entity base
fields
Bundle
Drupal for Symfony Developers Samuel Solís - @estoyausente
Regions
Blocks
Click!
Drupal for Symfony Developers Samuel Solís - @estoyausente
Block configuration
Block visibility
Drupal for Symfony Developers Samuel Solís - @estoyausente
Module types
Drupal for Symfony Developers Samuel Solís - @estoyausente
Module configurations
Drupal for Symfony Developers Samuel Solís - @estoyausente
User Roles
Module
permissions
Drupal for Symfony Developers Samuel Solís - @estoyausente
Some awesome
module suites
Drupal for Symfony Developers Samuel Solís - @estoyausente
Media
Drupal for Symfony Developers Samuel Solís - @estoyausente
Workflow
Drupal for Symfony Developers Samuel Solís - @estoyausente
REST & JSON API
Drupal for Symfony Developers Samuel Solís - @estoyausente
Migrate
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drush
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal structure
composer.json
composer.lock
config/
.git
LICENSE
README.md
scripts/
.travis.yml
vendor/
web/
autoload.php
core/
error.html
error.php
favicon.ico
index.php
libraries/
modules/
profiles/
robots.txt
sites/
themes/
update.php
web.config
contrib/
custom/
[shared/]
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal module structure
config/
src/
templates/
tests/
migrations/
modules/
module_name.module
module_name.info.yml
module_name.*.yml
README.md
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal theme structure
config/
templates/
images/
css/
js/
images/
theme_name.info.yml
theme_name.libraries.yml
theme_name.theme
A theme is an special module,
but a module. The structure is
the same.
Drupal for Symfony Developers Samuel Solís - @estoyausente
Some random code snippets
Drupal for Symfony Developers Samuel Solís - @estoyausente
bb_data_layer.routing.yml
bb_data_layer.provider.autocomplete:
path: '/provider-autocomplete/{search_field_name}/{return_field_name}'
defaults:
_controller:
'Drupalbb_data_layerControllerAutocompleteController::providerAutocomp
lete'
_format: json
requirements:
_access: 'TRUE'
...
Drupal for Symfony Developers Samuel Solís - @estoyausente
bb_data_layer.services.yml
services:
bb_data_layer.marketplace_wines:
class: Drupalbb_data_layerMarketplaceWines
bb_data_layer.product_sales:
class: Drupalbb_data_layerProductSales
...
Drupal for Symfony Developers Samuel Solís - @estoyausente
AutocompleteController.php
<?php
namespace Drupalbb_data_layerController;
use DrupalCoreControllerControllerBase;
...
class AutocompleteController extends ControllerBase {
public function providerAutocomplete(Request $request, $search_field_name,
$return_field_name) {
$return = []; // some stuff
return new JsonResponse($return);
}
}
Drupal for Symfony Developers Samuel Solís - @estoyausente
HazteSocio.php
/**
* Provides an example block.
* @Block(
* id = "bb_blocks_haztesocio",
* admin_label = @Translation("Register now"),
* )
*/
class HazteSocio extends BlockBase {
public function build() {
return [
'forms' => [
'facebook' => $this->facebook,
'#type' => 'container',
'#attributes' => [
'class' => ['user-register-input-wrapper'],
],
]
}
}
}
Drupal for Symfony Developers Samuel Solís - @estoyausente
Symfony Components in D8
● ClassLoader
● CssSelector
● DependencyInjection
● EventDispatcher
● HttpFoundation
● HttpKernel
● Process
● Routing
● Serializer
● Translation
● Validator
● Yaml
Drupal for Symfony Developers Samuel Solís - @estoyausente
DependencyInjection & Services
$logger = $container->get('logger');
$entityManager = $container->get(entity.orm.entity_manager');
Drupal for Symfony Developers Samuel Solís - @estoyausente
Event & Event dispatcher
class UserLoginEvent extends Event {
const EVENT_NAME = 'bb_auth_user_login';
public $account;
public function __construct(UserInterface $account) {
$this->account = $account;
}
}
Drupal for Symfony Developers Samuel Solís - @estoyausente
Event & Event dispatcher
$event = new UserLoginEvent($account);
// Get the event_dispatcher service and dispatch the event.
$event_dispatcher = Drupal::service('event_dispatcher');
$event_dispatcher->dispatch(UserLoginEvent::EVENT_NAME, $event);
Drupal for Symfony Developers Samuel Solís - @estoyausente
Event & Event dispatcher
class BbAuthApiRequest implements EventSubscriberInterface {
public function onAPIRequest(BbRestRequest $event) {}
public static function getSubscribedEvents() {
$events[BbRestRequest::BB_REST_REQUEST][] = ['onAPIRequest'];
return $events;
}
}
Drupal for Symfony Developers Samuel Solís - @estoyausente
Ya casi acabamos
Drupal for Symfony Developers Samuel Solís - @estoyausente
Drupal community & support
● Drupalchat.eu (Rocket chat) -
Spanish channel #drupal-es
● Groups.drupal.org
● Drupal.slack.com
● drupal.stackexchange.com
Day to day Events
Drupal for Symfony Developers Samuel Solís - @estoyausente
Thank for coming!

Contenu connexe

Similaire à Drupal intro for Symfony developers

Hacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorHacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorAhmed Sulaiman
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introEdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introBryan Ollendyke
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
CivicActions Drupal Directory Structure
CivicActions Drupal Directory StructureCivicActions Drupal Directory Structure
CivicActions Drupal Directory StructureGregory Heller
 
Drupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaDrupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaGábor Hojtsy
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementShapeBlue
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGapAlex S
 
Drupal in 30 Minutes
Drupal in 30 MinutesDrupal in 30 Minutes
Drupal in 30 MinutesRobert Carr
 
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Mir Nazim
 
Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security rightGábor Hojtsy
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 

Similaire à Drupal intro for Symfony developers (20)

Hacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for SimulatorHacking iOS Simulator: writing your own plugins for Simulator
Hacking iOS Simulator: writing your own plugins for Simulator
 
Knolx session
Knolx sessionKnolx session
Knolx session
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal introEdTechJoker Spring 2020 - Lecture 7 Drupal intro
EdTechJoker Spring 2020 - Lecture 7 Drupal intro
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Sightly_techInsight
Sightly_techInsightSightly_techInsight
Sightly_techInsight
 
CivicActions Drupal Directory Structure
CivicActions Drupal Directory StructureCivicActions Drupal Directory Structure
CivicActions Drupal Directory Structure
 
Drupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaDrupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp Bratislava
 
Overview Of Drupal
Overview Of DrupalOverview Of Drupal
Overview Of Drupal
 
Overview Of Drupal
Overview Of DrupalOverview Of Drupal
Overview Of Drupal
 
Ansible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration ManagementAnsible & CloudStack - Configuration Management
Ansible & CloudStack - Configuration Management
 
Drupal
DrupalDrupal
Drupal
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Drupal in 30 Minutes
Drupal in 30 MinutesDrupal in 30 Minutes
Drupal in 30 Minutes
 
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
 
Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security right
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 

Plus de Samuel Solís Fuentes

Plus de Samuel Solís Fuentes (16)

De managers y developers
De managers y developersDe managers y developers
De managers y developers
 
Hábitos y consejos para sobrevivir a un trabajo sedentario
Hábitos y consejos para sobrevivir a un trabajo sedentarioHábitos y consejos para sobrevivir a un trabajo sedentario
Hábitos y consejos para sobrevivir a un trabajo sedentario
 
Querying solr
Querying solrQuerying solr
Querying solr
 
Las tripas de un sistema solr
Las tripas de un sistema solrLas tripas de un sistema solr
Las tripas de un sistema solr
 
D8 Form api
D8 Form apiD8 Form api
D8 Form api
 
Mejorar tu código mejorando tu comunicación
Mejorar tu código mejorando tu comunicaciónMejorar tu código mejorando tu comunicación
Mejorar tu código mejorando tu comunicación
 
Custom entities in d8
Custom entities in d8Custom entities in d8
Custom entities in d8
 
Drupal8 simplepage v2
Drupal8 simplepage v2Drupal8 simplepage v2
Drupal8 simplepage v2
 
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
 
Como arreglar este desastre
Como arreglar este desastreComo arreglar este desastre
Como arreglar este desastre
 
Drupal y rails. Nuestra experiencia
Drupal y rails. Nuestra experienciaDrupal y rails. Nuestra experiencia
Drupal y rails. Nuestra experiencia
 
Mejorar tu código hablando con el cliente
Mejorar tu código hablando con el clienteMejorar tu código hablando con el cliente
Mejorar tu código hablando con el cliente
 
Taller de introducción al desarrollo de módulos
Taller de introducción al desarrollo de módulosTaller de introducción al desarrollo de módulos
Taller de introducción al desarrollo de módulos
 
Más limpio que un jaspe.
Más limpio que un jaspe.Más limpio que un jaspe.
Más limpio que un jaspe.
 
Arquitectura de información en drupal
Arquitectura de información en drupalArquitectura de información en drupal
Arquitectura de información en drupal
 
Drupal para desarrolladores
Drupal para desarrolladoresDrupal para desarrolladores
Drupal para desarrolladores
 

Dernier

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Dernier (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Drupal intro for Symfony developers

  • 1. Drupal for Symfony Developers Samuel Solís - @estoyausenteSamuel Solís - @estoyausente Drupal for Symfony Developers By Samuel Solís
  • 2. Drupal for Symfony Developers Samuel Solís - @estoyausente A PHP CMS Samuel Solís - @estoyausente ¿What is Drupal? Open Source Highly customizable Usually called as CMF
  • 3. Drupal for Symfony Developers Samuel Solís - @estoyausente Main features Security Performance & Scaling Multilingual Marketing automation Content management Personalization Content as a Service
  • 4. Drupal for Symfony Developers Samuel Solís - @estoyausente A lot of contrib modules
  • 5. Drupal for Symfony Developers Samuel Solís - @estoyausente Note about Drupal versions <D7 D7 D8 Old like a mountain, now unpredictable Mature, important in the Drupal story Young, different, the real hero
  • 6. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal install Usually LAMP environment but many variations possible. 1. Download the project https://github.com/drupal/recommended-project 2. Composer install 3. Install the database and configuration a. Go to the site and follow the install wizard b. Using drush with the command drush site-install
  • 7. Drupal for Symfony Developers Samuel Solís - @estoyausente
  • 8. Drupal for Symfony Developers Samuel Solís - @estoyausente
  • 9. Drupal for Symfony Developers Samuel Solís - @estoyausente
  • 10. Drupal for Symfony Developers Samuel Solís - @estoyausente
  • 11. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal content structure
  • 12. Drupal for Symfony Developers Samuel Solís - @estoyausente Entity Config Entity Content Entity Views Languages ... Node Comment ... Article Basic Page ... *.yml
  • 13. Drupal for Symfony Developers Samuel Solís - @estoyausente A config entity example: Views
  • 14. Drupal for Symfony Developers Samuel Solís - @estoyausente A content entity example: Nodes
  • 15. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal UI tour
  • 16. Drupal for Symfony Developers Samuel Solís - @estoyausente Entity Types Bulk operations Entity base fields Bundle
  • 17. Drupal for Symfony Developers Samuel Solís - @estoyausente Regions Blocks Click!
  • 18. Drupal for Symfony Developers Samuel Solís - @estoyausente Block configuration Block visibility
  • 19. Drupal for Symfony Developers Samuel Solís - @estoyausente Module types
  • 20. Drupal for Symfony Developers Samuel Solís - @estoyausente Module configurations
  • 21. Drupal for Symfony Developers Samuel Solís - @estoyausente User Roles Module permissions
  • 22. Drupal for Symfony Developers Samuel Solís - @estoyausente Some awesome module suites
  • 23. Drupal for Symfony Developers Samuel Solís - @estoyausente Media
  • 24. Drupal for Symfony Developers Samuel Solís - @estoyausente Workflow
  • 25. Drupal for Symfony Developers Samuel Solís - @estoyausente REST & JSON API
  • 26. Drupal for Symfony Developers Samuel Solís - @estoyausente Migrate
  • 27. Drupal for Symfony Developers Samuel Solís - @estoyausente Drush
  • 28. Drupal for Symfony Developers Samuel Solís - @estoyausente
  • 29. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal structure composer.json composer.lock config/ .git LICENSE README.md scripts/ .travis.yml vendor/ web/ autoload.php core/ error.html error.php favicon.ico index.php libraries/ modules/ profiles/ robots.txt sites/ themes/ update.php web.config contrib/ custom/ [shared/]
  • 30. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal module structure config/ src/ templates/ tests/ migrations/ modules/ module_name.module module_name.info.yml module_name.*.yml README.md
  • 31. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal theme structure config/ templates/ images/ css/ js/ images/ theme_name.info.yml theme_name.libraries.yml theme_name.theme A theme is an special module, but a module. The structure is the same.
  • 32. Drupal for Symfony Developers Samuel Solís - @estoyausente Some random code snippets
  • 33. Drupal for Symfony Developers Samuel Solís - @estoyausente bb_data_layer.routing.yml bb_data_layer.provider.autocomplete: path: '/provider-autocomplete/{search_field_name}/{return_field_name}' defaults: _controller: 'Drupalbb_data_layerControllerAutocompleteController::providerAutocomp lete' _format: json requirements: _access: 'TRUE' ...
  • 34. Drupal for Symfony Developers Samuel Solís - @estoyausente bb_data_layer.services.yml services: bb_data_layer.marketplace_wines: class: Drupalbb_data_layerMarketplaceWines bb_data_layer.product_sales: class: Drupalbb_data_layerProductSales ...
  • 35. Drupal for Symfony Developers Samuel Solís - @estoyausente AutocompleteController.php <?php namespace Drupalbb_data_layerController; use DrupalCoreControllerControllerBase; ... class AutocompleteController extends ControllerBase { public function providerAutocomplete(Request $request, $search_field_name, $return_field_name) { $return = []; // some stuff return new JsonResponse($return); } }
  • 36. Drupal for Symfony Developers Samuel Solís - @estoyausente HazteSocio.php /** * Provides an example block. * @Block( * id = "bb_blocks_haztesocio", * admin_label = @Translation("Register now"), * ) */ class HazteSocio extends BlockBase { public function build() { return [ 'forms' => [ 'facebook' => $this->facebook, '#type' => 'container', '#attributes' => [ 'class' => ['user-register-input-wrapper'], ], ] } } }
  • 37. Drupal for Symfony Developers Samuel Solís - @estoyausente Symfony Components in D8 ● ClassLoader ● CssSelector ● DependencyInjection ● EventDispatcher ● HttpFoundation ● HttpKernel ● Process ● Routing ● Serializer ● Translation ● Validator ● Yaml
  • 38. Drupal for Symfony Developers Samuel Solís - @estoyausente DependencyInjection & Services $logger = $container->get('logger'); $entityManager = $container->get(entity.orm.entity_manager');
  • 39. Drupal for Symfony Developers Samuel Solís - @estoyausente Event & Event dispatcher class UserLoginEvent extends Event { const EVENT_NAME = 'bb_auth_user_login'; public $account; public function __construct(UserInterface $account) { $this->account = $account; } }
  • 40. Drupal for Symfony Developers Samuel Solís - @estoyausente Event & Event dispatcher $event = new UserLoginEvent($account); // Get the event_dispatcher service and dispatch the event. $event_dispatcher = Drupal::service('event_dispatcher'); $event_dispatcher->dispatch(UserLoginEvent::EVENT_NAME, $event);
  • 41. Drupal for Symfony Developers Samuel Solís - @estoyausente Event & Event dispatcher class BbAuthApiRequest implements EventSubscriberInterface { public function onAPIRequest(BbRestRequest $event) {} public static function getSubscribedEvents() { $events[BbRestRequest::BB_REST_REQUEST][] = ['onAPIRequest']; return $events; } }
  • 42. Drupal for Symfony Developers Samuel Solís - @estoyausente Ya casi acabamos
  • 43. Drupal for Symfony Developers Samuel Solís - @estoyausente Drupal community & support ● Drupalchat.eu (Rocket chat) - Spanish channel #drupal-es ● Groups.drupal.org ● Drupal.slack.com ● drupal.stackexchange.com Day to day Events
  • 44. Drupal for Symfony Developers Samuel Solís - @estoyausente Thank for coming!