Your SlideShare is downloading. ×
Drupal as a web framework
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Drupal as a web framework

1,519
views

Published on

Drupal isn't a content management system. It's an application development platform that happens to ship with a great CMS as it's default implementation. Look at any chart comparing features of …

Drupal isn't a content management system. It's an application development platform that happens to ship with a great CMS as it's default implementation. Look at any chart comparing features of development frameworks and you'll see user management and authentication, forms management and validation, data storage, database migrations, internationalization and translation, MVC model with flexible templating, unit testing, and caching. Sounds a lot like Drupal. We'll look at why Drupal is an ideal application development platform for apps beyond content management, talk about where Drupal can improve in these areas, and look at an example application.

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,519
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Drupal as a WebFramework
  • 2. Adam Kalseyadam@tropo.com@akalseyTropowww.Tropo.com@tropo
  • 3. “A web application framework is a softwareframework that is designed to support thedevelopment of dynamic websites, Webapplications and Web services. Theframework aims to alleviate the overheadassociated with common activitiesperformed in Web development.” - Wikipedia
  • 4. UserManagement
  • 5. user.modulefields.module
  • 6. Database Access
  • 7. $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);
  • 8. $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 => ,);
  • 9. 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),
  • 10. $form[audioblogger][phone] = array( #type => textfield, #title => t(Phone), #default_value => empty($edit[phone]) ? : $edit[phone], #description => t(The phone numberyou usually will call in from.));
  • 11. function audioblogger_menu() { $items = array(); $items[audioblogger/answer] = array( page callback =>audioblogger_answer, access arguments => array(accesscontent), type => MENU_NORMAL_ITEM, );
  • 12. #: includes/common.inc:344 modules/system/system.admin.inc:1645msgid "@site is currently undermaintenance. 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;145msgid "MB"msgstr ""
  • 13. <?php if (isset($primary_links)) : ?> <?php print theme(links,$primary_links, array(class => linksprimary-links)) ?><?php endif; ?><?php if (isset($secondary_links)) : ?> <?php print theme(links,$secondary_links, array(class =>links secondary-links)) ?><?php endif; ?>
  • 14. What about MVC?
  • 15. /** * Default implementation ofDrupalEntityControllerInterface. * * This class can be used as-is by mostsimple entity types. Entity types * requiring special handling canextend the class. */class DrupalDefaultEntityControllerimplementsDrupalEntityControllerInterface {
  • 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; ?>
  • 17. function audioblogger_menu() { $items = array(); $items[audioblogger/answer] =array( page callback =>audioblogger_answer, access arguments => array(access content), type => MENU_NORMAL_ITEM, );
  • 18. What does Drupal need?
  • 19. Demo time
  • 20. function frameworkdemo_menu() { $items = array(); $items[demo/answer] = array( page callback => demo_answer, access arguments => array(accesscontent), type => MENU_NORMAL_ITEM, ); return $items;}
  • 21. 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;}
  • 22. www.Tropo.com
  • 23. (604) 800-9142
  • 24. Free developer accounts: http://Tropo.comDemo module source:https://github.com/akalsey/drupal-framework-demoSlides: http://slideshare.com/akalseyFollow us on Twitter: @TropoMe: Adam Kalsey | adam@tropo.com | @akalsey