SlideShare a Scribd company logo
Drupal as a Web
Framework
Adam Kalsey
adam@tropo.com
@akalsey

Tropo
www.Tropo.com
@tropo
“A web application framework is a software
framework that is designed to support the
development of dynamic websites, Web
applications and Web services. The
framework aims to alleviate the overhead
associated with common activities
performed in Web development.”


                                - Wikipedia
User
Management
user.module


fields.module
Drupal as a web framework
Drupal as a web framework
Drupal as a web framework
Database Access
$query = db_select('search_index',
'i', array('target' => 'slave'))-
>extend('SearchQuery')-
>extend('PagerDefault');
  $query->join('node', 'n', 'n.nid =
i.sid');
  $query
    ->condition('n.status', 1)
    ->addTag('node_access')
    ->searchExpression($keys, 'node');
$databases['default']['default'] = array(
   'driver' => 'mysql',
   'database' => 'databasename',
   'username' => 'username',
   'password' => 'password',
   'host' => 'localhost',
   'prefix' => 'main_',
   'collation' => 'utf8_general_ci',
);

$databases['default']['default'] = array (
   'database' => 'sites/default/files/.ht.sqlite',
   'driver' => 'sqlite',
   'prefix' => '',
);
function audioblogger_schema() {
  $schema = array();
  $schema['audioblogger'] = array(
    'fields' => array(
    'uid' => array('type' => 'int',
'unsigned' => TRUE, 'not null' => TRUE,
'default' => 0, 'disp-width' => '10'),
    'bloguser' => array('type' =>
'varchar', 'length' => '255', 'not null'
=> TRUE),
$form['audioblogger']['phone'] = array(
  '#type' => 'textfield',
  '#title' => t('Phone'),
  '#default_value' =>
empty($edit['phone']) ? '' :
$edit['phone'],
  '#description' => t('The phone number
you usually will call in from.'));
function audioblogger_menu() {
  $items = array();

  $items['audioblogger/answer'] =
array(
     'page callback' =>
'audioblogger_answer',
     'access arguments' => array('access
content'),
     'type' => MENU_NORMAL_ITEM,
  );
#: includes/common.inc:344 modules/
system/system.admin.inc:1645
msgid "@site is currently under
maintenance. We should be back shortly.
Thank you for your patience."
msgstr ""

#: includes/common.inc:1211 modules/
blogapi/blogapi.module:739;749 modules/
upload/upload.admin.inc:98;107;136;145
msgid "MB"
msgstr ""
<?php if (isset($primary_links)) : ?>
  <?php print theme('links',
$primary_links, array('class' => 'links
primary-links')) ?>
<?php endif; ?>
<?php if (isset($secondary_links)) : ?>
  <?php print theme('links',
$secondary_links, array('class' =>
'links secondary-links')) ?>
<?php endif; ?>
Drupal as a web framework
What about
 MVC?
/**
 * Default implementation of
DrupalEntityControllerInterface.
 *
 * This class can be used as-is by most
simple entity types. Entity types
 * requiring special handling can
extend the class.
 */
class DrupalDefaultEntityController
implements
DrupalEntityControllerInterface {
<?php if (isset($primary_links)) : ?>
  <?php print theme('links',
$primary_links, array('class' =>
'links primary-links')) ?>
<?php endif; ?>
<?php if
(isset($secondary_links)) : ?>
  <?php print theme('links',
$secondary_links, array('class' =>
'links secondary-links')) ?>
<?php endif; ?>
function audioblogger_menu() {
  $items = array();

  $items['audioblogger/answer'] =
array(
     'page callback' =>
'audioblogger_answer',
     'access arguments' =>
array('access content'),
     'type' => MENU_NORMAL_ITEM,
  );
Drupal as a web framework
Drupal as a web framework
Drupal as a web framework
What does Drupal
     need?
Demo time
function frameworkdemo_menu() {
  $items = array();
  $items['demo/answer'] = array(
     'page callback' => 'demo_answer',
     'access arguments' => array('access
content'),
     'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}
function frameworkdemo_answer() {
  include_once 'tropo.class.php';
  $tropo = new Tropo();
  $session = new Session();
  $caller = $session->getFrom();
  $number = $caller['id'];
  $tropo->say('Thanks for coming!');
  $_SESSION['caller'] = $number;
  $tropo->on(array('event' =>
'continue', 'next'=> url('demo/
thanks/')));
  frameworkdemo_save($number);
  print $tropo;
}
www.Tropo.com
Drupal as a web framework
(604) 800-9142
Free developer accounts: http://Tropo.com

Demo module source:
https://github.com/akalsey/drupal-framework-demo

Slides: http://slideshare.com/akalsey/drupal-as-a-web-
framework

Follow us on Twitter: @Tropo
Me: Adam Kalsey | adam@tropo.com | @akalsey

More Related Content

PDF
Django at the Disco
ZIP
Django at the Disco
KEY
PHPConf-TW 2012 # Twig
PDF
Django Multi-DB in Anger
PDF
Drupal 8 Services
PDF
Dandelion 0.10.0
PPTX
Drupal.js: Best Practices for Managing Javascript in Drupal
Django at the Disco
Django at the Disco
PHPConf-TW 2012 # Twig
Django Multi-DB in Anger
Drupal 8 Services
Dandelion 0.10.0
Drupal.js: Best Practices for Managing Javascript in Drupal

What's hot (17)

KEY
Deploying
PDF
In-depth changes to Drupal 8 javascript
KEY
JavaScript in Drupal 7: What developers need to know
ODP
Running ms sql stored procedures in mule
KEY
Intro To jQuery In Drupal
PDF
Configuring a more secure BOSH
KEY
Authentication
KEY
Google
PDF
Getting Into Drupal 8 Configuration
PDF
Drupal 8 Services And Dependency Injection
KEY
[Coscup 2012] JavascriptMVC
PDF
Doctrine 2
PDF
Backbone js in drupal core
PPT
Php frameworks
PPT
Drupal Javascript for developers
PDF
The new static resources framework
PDF
diego chipantasi
Deploying
In-depth changes to Drupal 8 javascript
JavaScript in Drupal 7: What developers need to know
Running ms sql stored procedures in mule
Intro To jQuery In Drupal
Configuring a more secure BOSH
Authentication
Google
Getting Into Drupal 8 Configuration
Drupal 8 Services And Dependency Injection
[Coscup 2012] JavascriptMVC
Doctrine 2
Backbone js in drupal core
Php frameworks
Drupal Javascript for developers
The new static resources framework
diego chipantasi
Ad

Viewers also liked (8)

PPT
презентація проект1
PDF
Springbreak
PDF
Tο Nησι γερμανικη κατοχη - Vicroria hislop
DOCX
ODP
Tähised
PPTX
semana de acogida
PPTX
Grandes coches de la actualidad
презентація проект1
Springbreak
Tο Nησι γερμανικη κατοχη - Vicroria hislop
Tähised
semana de acogida
Grandes coches de la actualidad
Ad

Similar to Drupal as a web framework (20)

PDF
Service discovery and configuration provisioning
PDF
Web applications with Catalyst
KEY
Yii Introduction
PPTX
Drupal II: The SQL
PDF
Opencast Admin UI - Introduction to developing using AngularJS
PPTX
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
PDF
Supercharging WordPress Development - Wordcamp Brighton 2019
PPT
Responsive Design with WordPress (WCPHX)
PPTX
Migrate yourself. code -> module -> mind
PPTX
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
ZIP
Django at the Disco
ZIP
Django at the Disco
ZIP
Django at the Disco
PDF
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
PDF
WordPress Café: Using WordPress as a Framework
ODP
CodeIgniter PHP MVC Framework
PDF
Drupal 7 Theming - Behind the scenes
KEY
PDF
JQuery In Drupal
PDF
WCLA12 JavaScript
Service discovery and configuration provisioning
Web applications with Catalyst
Yii Introduction
Drupal II: The SQL
Opencast Admin UI - Introduction to developing using AngularJS
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
Supercharging WordPress Development - Wordcamp Brighton 2019
Responsive Design with WordPress (WCPHX)
Migrate yourself. code -> module -> mind
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Django at the Disco
Django at the Disco
Django at the Disco
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
WordPress Café: Using WordPress as a Framework
CodeIgniter PHP MVC Framework
Drupal 7 Theming - Behind the scenes
JQuery In Drupal
WCLA12 JavaScript

More from Adam Kalsey (6)

PDF
Public Speaking for Geeks
PDF
Drupal 7 module development
PDF
East Bay Ruby Tropo presentation
PDF
Introduction to jRuby
PDF
Tuning Drupal for Scale and Performance
PDF
Drupal Module APIs
Public Speaking for Geeks
Drupal 7 module development
East Bay Ruby Tropo presentation
Introduction to jRuby
Tuning Drupal for Scale and Performance
Drupal Module APIs

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
1. Introduction to Computer Programming.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Machine Learning_overview_presentation.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Tartificialntelligence_presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
1. Introduction to Computer Programming.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Machine Learning_overview_presentation.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MYSQL Presentation for SQL database connectivity
Tartificialntelligence_presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...

Drupal as a web framework

  • 1. Drupal as a Web Framework
  • 3. “A web application framework is a software framework that is designed to support the development of dynamic websites, Web applications and Web services. The framework aims to alleviate the overhead associated with common activities performed in Web development.” - Wikipedia
  • 10. $query = db_select('search_index', 'i', array('target' => 'slave'))- >extend('SearchQuery')- >extend('PagerDefault'); $query->join('node', 'n', 'n.nid = i.sid'); $query ->condition('n.status', 1) ->addTag('node_access') ->searchExpression($keys, 'node');
  • 11. $databases['default']['default'] = array( 'driver' => 'mysql', 'database' => 'databasename', 'username' => 'username', 'password' => 'password', 'host' => 'localhost', 'prefix' => 'main_', 'collation' => 'utf8_general_ci', ); $databases['default']['default'] = array ( 'database' => 'sites/default/files/.ht.sqlite', 'driver' => 'sqlite', 'prefix' => '', );
  • 12. function audioblogger_schema() { $schema = array(); $schema['audioblogger'] = array( 'fields' => array( 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'), 'bloguser' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE),
  • 13. $form['audioblogger']['phone'] = array( '#type' => 'textfield', '#title' => t('Phone'), '#default_value' => empty($edit['phone']) ? '' : $edit['phone'], '#description' => t('The phone number you usually will call in from.'));
  • 14. function audioblogger_menu() { $items = array(); $items['audioblogger/answer'] = array( 'page callback' => 'audioblogger_answer', 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, );
  • 15. #: includes/common.inc:344 modules/ system/system.admin.inc:1645 msgid "@site is currently under maintenance. We should be back shortly. Thank you for your patience." msgstr "" #: includes/common.inc:1211 modules/ blogapi/blogapi.module:739;749 modules/ upload/upload.admin.inc:98;107;136;145 msgid "MB" msgstr ""
  • 16. <?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?> <?php endif; ?> <?php if (isset($secondary_links)) : ?> <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?> <?php endif; ?>
  • 19. /** * Default implementation of DrupalEntityControllerInterface. * * This class can be used as-is by most simple entity types. Entity types * requiring special handling can extend the class. */ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
  • 20. <?php if (isset($primary_links)) : ?> <?php print theme('links', $primary_links, array('class' => 'links primary-links')) ?> <?php endif; ?> <?php if (isset($secondary_links)) : ?> <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?> <?php endif; ?>
  • 21. function audioblogger_menu() { $items = array(); $items['audioblogger/answer'] = array( 'page callback' => 'audioblogger_answer', 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, );
  • 27. function frameworkdemo_menu() { $items = array(); $items['demo/answer'] = array( 'page callback' => 'demo_answer', 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, ); return $items; }
  • 28. function frameworkdemo_answer() { include_once 'tropo.class.php'; $tropo = new Tropo(); $session = new Session(); $caller = $session->getFrom(); $number = $caller['id']; $tropo->say('Thanks for coming!'); $_SESSION['caller'] = $number; $tropo->on(array('event' => 'continue', 'next'=> url('demo/ thanks/'))); frameworkdemo_save($number); print $tropo; }
  • 32. Free developer accounts: http://Tropo.com Demo module source: https://github.com/akalsey/drupal-framework-demo Slides: http://slideshare.com/akalsey/drupal-as-a-web- framework Follow us on Twitter: @Tropo Me: Adam Kalsey | [email protected] | @akalsey