Let's Talk Drupal

Rahul Shinde

API

(Application Programming Interface)

API

  • An API is a software-to-software interface, not a user interface.
  • An API resembles Software as a Service (SaaS).
  • Josh Walker says , an analyst at Forrester Research Inc. in Cambridge, Mass., 
"Building an application with no APIs is basically like building a house with no doors. The API for all computing purposes is how you open the blinds and the doors and exchange information."

Drupal API

  • Module system (Drupal hooks)
  • Database API
  • Menu system
  • Form generation
  • File upload system
  • Field API
  • Search system
  • Node access system
  • Theme system





Module system (Drupal hooks)


  • To extend Drupal, a module need simply implement a hook.

  • e.g. hook_help()
/**
 * Implements hook_help().
 */
function demo_help($path, $arg) {
  if ($path == 'admin/help#demo') {
    return t('A demonstration module.');
  }
} 




Database API


The API is designed to preserve the syntax and power of SQL as much as possible, but also:
  • to support multiple database servers easily;
  • to allow developers to leverage more complex functionality, such as transactions;
  • to provide a structured interface for the dynamic construction of queries;
  • to enforce security checks and other good practices;
  • to provide modules with a clean interface for intercepting and modifying a site's queries.




Menu system



  • navigation system 


  • callback system




Form generation




Search system




Theme system


Any Suggestion??


Drupal API

By Rahul Shinde

Drupal API

  • 845