SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
DRUPAL as a framework
Samuel Solís
@estoyausente
linkedin.com/in/samuelsolisfuentes
Drupal as a framework Samuel Solís | @estoyausente
What is DRUPAL?
Drupal as framework Samuel Solís | @estoyausente
CMSs Frameworks
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
CMSs Frameworks
¿CMF?
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
Drupal inside
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
diff drupal7 drupal8
- PAC (presentation-abstraction-control)!
+ MVC!
+ Orient-Object code!
+ PHP standards!
+ Symfony2 component!
+ Twig!
+ Build-in web services!
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
PAC
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
Drupal7’s PAC
http://dsheiko.com/
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
http://dsheiko.com/
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
! block_example/!
├── block_example.info
├── block_example.install
├── block_example.module
└── block_example.test
tree block_example
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
function block_example_block_info() {!
$blocks['example_configurable_text'] = !!
array(!
'info' => t('Example),!
'cache' => DRUPAL_CACHE_PER_ROLE,!
);!
return $blocks;!
} !
vi block_example.module
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
function block_example_block_configure($delta =
'') {!
$form = array();!
if ($delta == ‘example_configurable_text’){!
$form['block_example_string'] = array(!
'#type' => ‘textfield',!
'#title' => t('Block contents’),!
'#size' => 60,!
'#description' => t('This text example'),!
'#default_value' =>
variable_get('block_example_string', t('Some
example content.’)),!
); !
}
return $form;!
}
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
function block_example_block_save($delta =
'', $edit = array()) {!
if ($delta == ‘example_configurable_text’){!
! variable_set(‘block_example_string’,!
! $edit[‘block_example_string’]);!
}!
}!
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
function block_example_block_view($delta =
'') {
switch ($delta) {!
case ‘example_configurable_text':!
$block['subject'] = t('Title');
$block['content'] =
block_example_contents();!
break; !
}!
return $block;!
}!
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
function block_example_contents() {
return variable_get(‘block_example_string’);!
}!
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
Drupal8’s MVC
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
block_example/
├── block_example.info.yml
├── block_example.module
├── block_example.routing.yml
└── lib
└── Drupal
└── block_example
├── Controller
│   └── BlockExampleController.php
├── Plugin
│   └── Block
│   ├── ExampleConfigurableTextBlock.php
│   ├── ExampleEmptyBlock.php
│   └── ExampleUppercaseBlock.php
└── Tests
├── BlockExampleMenuTest.php
└── BlockExampleTest.php
tree block_example
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
block_example/
├── block_example.info.yml
├── block_example.module
├── block_example.routing.yml
└── lib
└── Drupal
└── block_example
├── Controller
│   └── BlockExampleController.php
├── Plugin
│   └── Block
│   ├── ExampleConfigurableTextBlock.php
│   ├── ExampleEmptyBlock.php
│   └── ExampleUppercaseBlock.php
└── Tests
├── BlockExampleMenuTest.php
└── BlockExampleTest.php
tree block_example
Drupal as a framework Samuel Solís | @estoyausente
PSR 0
Drupal for devs Samuel Solís | @estoyausente
function block_example_menu_link_defaults() {
$links['block_example'] = array(
'link_title' => 'Block Example’,
'route_name' => ‘block_example.description',
);
return $links;
}
vi block_example.module
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
block_example.description:
path: ‘examples/block_example’
defaults:
_content:
'Drupalblock_exampleController
BlockExampleController::description'
requirements:
_access: 'TRUE'
vi block_example.routing.yml
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
namespace Drupalblock_exampleController;
class BlockExampleController {
public function description() {
$build = array(
'#markup' => t(‘Descripion'),
);
return $build;
}
}
vi BlockExampleController.php
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
namespace Drupalblock_examplePluginBlock;
use DrupalblockAnnotationBlock;
use DrupalblockBlockBase;
use DrupalCoreAnnotationTranslation;
vi BlockExampleConfigurableText.php
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
class ExampleConfigurableTextBlock extends
BlockBase {
!
public function defaultConfiguration() {
return array(
'block_example_string' => t(‘Default'),
);
}
!
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
public function blockForm($form, &$form_state)
{
$form['block_example_string_text'] = array(
'#type' => ‘textfield',
'#title' => t('Block contents’),
'#size' => 60,
'#description' => t(‘Description'),
'#default_value' =>
$this->configuration[‘block_example_string'],
);
return $form;
}
!
!
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
public function blockSubmit($form, &
$form_state) {
$this->configuration['block_example_string']
= $form_state[‘values']
['block_example_string_text'];
}
Drupal as a framework Samuel Solís | @estoyausente
Drupal for devs Samuel Solís | @estoyausente
public function build() {
return array(
'#type' => ‘markup',
'#markup' =>
$this->configuration[‘block_example_string'],
);
}
!
}//end class
Drupal as a framework Samuel Solís | @estoyausente
Drupal as framework Samuel Solís | @estoyausente
Drush
Drupal as a framework Samuel Solís | @estoyausente
Samuel Solís
@estoyausente

Más contenido relacionado

La actualidad más candente

Top 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal ModulesTop 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal Modulesghing
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle themeKirill Borzov
 
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.Samuel Solís Fuentes
 
What we can learn from WordPress as a developer
What we can learn from WordPress as a developerWhat we can learn from WordPress as a developer
What we can learn from WordPress as a developerChandra Maharzan
 
Decoupling Your HTML, CSS & JavaScript
Decoupling Your HTML, CSS & JavaScriptDecoupling Your HTML, CSS & JavaScript
Decoupling Your HTML, CSS & JavaScriptTomislav Mesić
 
My sql presentation
My sql presentationMy sql presentation
My sql presentationNikhil Jain
 

La actualidad más candente (8)

$.Template
$.Template$.Template
$.Template
 
Top 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal ModulesTop 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal Modules
 
A better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UXA better CSS: Sass and Less - CC FE & UX
A better CSS: Sass and Less - CC FE & UX
 
Drupal 7 — Circle theme
Drupal 7 — Circle themeDrupal 7 — Circle theme
Drupal 7 — Circle theme
 
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.
 
What we can learn from WordPress as a developer
What we can learn from WordPress as a developerWhat we can learn from WordPress as a developer
What we can learn from WordPress as a developer
 
Decoupling Your HTML, CSS & JavaScript
Decoupling Your HTML, CSS & JavaScriptDecoupling Your HTML, CSS & JavaScript
Decoupling Your HTML, CSS & JavaScript
 
My sql presentation
My sql presentationMy sql presentation
My sql presentation
 

Similar a Drupal as a framework

Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Themingdrubb
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal APIAlexandru Badiu
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web frameworktaggg
 
Improve theming with (Twitter) Bootstrap
Improve theming with  (Twitter) BootstrapImprove theming with  (Twitter) Bootstrap
Improve theming with (Twitter) BootstrapAndrey Yurtaev
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Siva Epari
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Developmentipsitamishra
 
Advanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewAdvanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewRyan Cross
 
Intro to Pylons / Pyramid
Intro to Pylons / PyramidIntro to Pylons / Pyramid
Intro to Pylons / PyramidEric Paxton
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?Alexandru Badiu
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal DevelopmentJeff Eaton
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...LEDC 2016
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindValentine Matsveiko
 
Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPDan Jesus
 
Drupal & javascript
Drupal & javascriptDrupal & javascript
Drupal & javascriptAlmog Baku
 
Functional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingFunctional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingEmma Jane Hogbin Westby
 
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
 

Similar a Drupal as a framework (20)

Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Theming
 
Learning the basics of the Drupal API
Learning the basics of the Drupal APILearning the basics of the Drupal API
Learning the basics of the Drupal API
 
Drupal Workshop: Introducción al Backend de Drupal
Drupal  Workshop: Introducción al Backend de DrupalDrupal  Workshop: Introducción al Backend de Drupal
Drupal Workshop: Introducción al Backend de Drupal
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web framework
 
Improve theming with (Twitter) Bootstrap
Improve theming with  (Twitter) BootstrapImprove theming with  (Twitter) Bootstrap
Improve theming with (Twitter) Bootstrap
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
 
Advanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your ViewAdvanced Drupal Views: Theming your View
Advanced Drupal Views: Theming your View
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Intro to Pylons / Pyramid
Intro to Pylons / PyramidIntro to Pylons / Pyramid
Intro to Pylons / Pyramid
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Drupal Development
Drupal DevelopmentDrupal Development
Drupal Development
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mind
 
Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHP
 
Drupal & javascript
Drupal & javascriptDrupal & javascript
Drupal & javascript
 
Functional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal ThemingFunctional FIPS: Learning PHP for Drupal Theming
Functional FIPS: Learning PHP for Drupal Theming
 
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
 

Más de Samuel Solís Fuentes

Más de Samuel Solís Fuentes (15)

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
 
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
 

Último

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
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
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
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
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
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
 

Último (20)

Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
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
 
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 ☂️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
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
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
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
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
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
 

Drupal as a framework

  • 1. DRUPAL as a framework Samuel Solís @estoyausente linkedin.com/in/samuelsolisfuentes
  • 2. Drupal as a framework Samuel Solís | @estoyausente What is DRUPAL?
  • 3. Drupal as framework Samuel Solís | @estoyausente CMSs Frameworks Drupal as a framework Samuel Solís | @estoyausente
  • 4. Drupal as framework Samuel Solís | @estoyausente CMSs Frameworks ¿CMF? Drupal as a framework Samuel Solís | @estoyausente
  • 5. Drupal as framework Samuel Solís | @estoyausente Drupal inside Drupal as a framework Samuel Solís | @estoyausente
  • 6. Drupal as framework Samuel Solís | @estoyausente diff drupal7 drupal8 - PAC (presentation-abstraction-control)! + MVC! + Orient-Object code! + PHP standards! + Symfony2 component! + Twig! + Build-in web services! Drupal as a framework Samuel Solís | @estoyausente
  • 7. Drupal as framework Samuel Solís | @estoyausente PAC Drupal as a framework Samuel Solís | @estoyausente
  • 8. Drupal as framework Samuel Solís | @estoyausente Drupal7’s PAC http://dsheiko.com/ Drupal as a framework Samuel Solís | @estoyausente
  • 9. Drupal as framework Samuel Solís | @estoyausente http://dsheiko.com/ Drupal as a framework Samuel Solís | @estoyausente
  • 10. Drupal for devs Samuel Solís | @estoyausente ! block_example/! ├── block_example.info ├── block_example.install ├── block_example.module └── block_example.test tree block_example Drupal as a framework Samuel Solís | @estoyausente
  • 11. Drupal for devs Samuel Solís | @estoyausente function block_example_block_info() {! $blocks['example_configurable_text'] = !! array(! 'info' => t('Example),! 'cache' => DRUPAL_CACHE_PER_ROLE,! );! return $blocks;! } ! vi block_example.module Drupal as a framework Samuel Solís | @estoyausente
  • 12. Drupal for devs Samuel Solís | @estoyausente function block_example_block_configure($delta = '') {! $form = array();! if ($delta == ‘example_configurable_text’){! $form['block_example_string'] = array(! '#type' => ‘textfield',! '#title' => t('Block contents’),! '#size' => 60,! '#description' => t('This text example'),! '#default_value' => variable_get('block_example_string', t('Some example content.’)),! ); ! } return $form;! } Drupal as a framework Samuel Solís | @estoyausente
  • 13. Drupal for devs Samuel Solís | @estoyausente function block_example_block_save($delta = '', $edit = array()) {! if ($delta == ‘example_configurable_text’){! ! variable_set(‘block_example_string’,! ! $edit[‘block_example_string’]);! }! }! Drupal as a framework Samuel Solís | @estoyausente
  • 14. Drupal for devs Samuel Solís | @estoyausente function block_example_block_view($delta = '') { switch ($delta) {! case ‘example_configurable_text':! $block['subject'] = t('Title'); $block['content'] = block_example_contents();! break; ! }! return $block;! }! Drupal as a framework Samuel Solís | @estoyausente
  • 15. Drupal for devs Samuel Solís | @estoyausente function block_example_contents() { return variable_get(‘block_example_string’);! }! Drupal as a framework Samuel Solís | @estoyausente
  • 16.
  • 17. Drupal as framework Samuel Solís | @estoyausente Drupal8’s MVC Drupal as a framework Samuel Solís | @estoyausente
  • 18. Drupal for devs Samuel Solís | @estoyausente block_example/ ├── block_example.info.yml ├── block_example.module ├── block_example.routing.yml └── lib └── Drupal └── block_example ├── Controller │   └── BlockExampleController.php ├── Plugin │   └── Block │   ├── ExampleConfigurableTextBlock.php │   ├── ExampleEmptyBlock.php │   └── ExampleUppercaseBlock.php └── Tests ├── BlockExampleMenuTest.php └── BlockExampleTest.php tree block_example Drupal as a framework Samuel Solís | @estoyausente
  • 19. Drupal for devs Samuel Solís | @estoyausente block_example/ ├── block_example.info.yml ├── block_example.module ├── block_example.routing.yml └── lib └── Drupal └── block_example ├── Controller │   └── BlockExampleController.php ├── Plugin │   └── Block │   ├── ExampleConfigurableTextBlock.php │   ├── ExampleEmptyBlock.php │   └── ExampleUppercaseBlock.php └── Tests ├── BlockExampleMenuTest.php └── BlockExampleTest.php tree block_example Drupal as a framework Samuel Solís | @estoyausente PSR 0
  • 20. Drupal for devs Samuel Solís | @estoyausente function block_example_menu_link_defaults() { $links['block_example'] = array( 'link_title' => 'Block Example’, 'route_name' => ‘block_example.description', ); return $links; } vi block_example.module Drupal as a framework Samuel Solís | @estoyausente
  • 21. Drupal for devs Samuel Solís | @estoyausente block_example.description: path: ‘examples/block_example’ defaults: _content: 'Drupalblock_exampleController BlockExampleController::description' requirements: _access: 'TRUE' vi block_example.routing.yml Drupal as a framework Samuel Solís | @estoyausente
  • 22. Drupal for devs Samuel Solís | @estoyausente namespace Drupalblock_exampleController; class BlockExampleController { public function description() { $build = array( '#markup' => t(‘Descripion'), ); return $build; } } vi BlockExampleController.php Drupal as a framework Samuel Solís | @estoyausente
  • 23. Drupal for devs Samuel Solís | @estoyausente namespace Drupalblock_examplePluginBlock; use DrupalblockAnnotationBlock; use DrupalblockBlockBase; use DrupalCoreAnnotationTranslation; vi BlockExampleConfigurableText.php Drupal as a framework Samuel Solís | @estoyausente
  • 24. Drupal for devs Samuel Solís | @estoyausente class ExampleConfigurableTextBlock extends BlockBase { ! public function defaultConfiguration() { return array( 'block_example_string' => t(‘Default'), ); } ! Drupal as a framework Samuel Solís | @estoyausente
  • 25. Drupal for devs Samuel Solís | @estoyausente public function blockForm($form, &$form_state) { $form['block_example_string_text'] = array( '#type' => ‘textfield', '#title' => t('Block contents’), '#size' => 60, '#description' => t(‘Description'), '#default_value' => $this->configuration[‘block_example_string'], ); return $form; } ! ! Drupal as a framework Samuel Solís | @estoyausente
  • 26. Drupal for devs Samuel Solís | @estoyausente public function blockSubmit($form, & $form_state) { $this->configuration['block_example_string'] = $form_state[‘values'] ['block_example_string_text']; } Drupal as a framework Samuel Solís | @estoyausente
  • 27. Drupal for devs Samuel Solís | @estoyausente public function build() { return array( '#type' => ‘markup', '#markup' => $this->configuration[‘block_example_string'], ); } ! }//end class Drupal as a framework Samuel Solís | @estoyausente
  • 28.
  • 29. Drupal as framework Samuel Solís | @estoyausente Drush Drupal as a framework Samuel Solís | @estoyausente