SlideShare a Scribd company logo
1 of 30
Download to read offline
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

More Related Content

What's hot

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
 

What's hot (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 to 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
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindValentine Matsveiko
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...LEDC 2016
 
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 to 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
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mind
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
 
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
 

More from Samuel Solís Fuentes

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

Recently uploaded

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
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
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
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
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
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
 
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
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
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
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
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
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
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
 
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
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 

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