Drupal Module APIs

56
Building APIs for your modules

description

Providing an API for your modules can make them more popular, reduce support requests from your users, and help you find new uses for your code. In this session, you'll learn how to add APIs to your modules, special considerations for modules with APIs, and find out about the APIs your module has by default. We'll talk about security, validation, and how to release and document your APIs to make life easier on other developers. Adam Kalsey created the Activity Stream module to build lifestreaming services into Drupal. Activity Stream's API allows any developer to add third party services to a lifestream. This talk will use real-world code samples from Activity Stream and from Drupal Core.

Transcript of Drupal Module APIs

Page 1: Drupal Module APIs

Building APIs for your modules

Page 2: Drupal Module APIs
Page 3: Drupal Module APIs

What’s an API?

Page 4: Drupal Module APIs

Application ProgrammingInterface

Page 5: Drupal Module APIs
Page 6: Drupal Module APIs
Page 7: Drupal Module APIs
Page 8: Drupal Module APIs

But why?

Page 9: Drupal Module APIs

Get help

Page 10: Drupal Module APIs

Other Smart People You

Smart People in the World

Page 11: Drupal Module APIs

Make your module better

Page 12: Drupal Module APIs

Be more popular

Page 13: Drupal Module APIs

Better code

Page 14: Drupal Module APIs

What can I do?

Page 15: Drupal Module APIs

Theming

Page 16: Drupal Module APIs

Feeds

Page 17: Drupal Module APIs

Work

Page 18: Drupal Module APIs

Settings

Page 19: Drupal Module APIs

API Design

Page 20: Drupal Module APIs

APIs are Forever

Page 21: Drupal Module APIs
Page 22: Drupal Module APIs

Edit ruthlessly

Page 23: Drupal Module APIs

Great. But how?

Page 24: Drupal Module APIs
Page 25: Drupal Module APIs
Page 26: Drupal Module APIs
Page 27: Drupal Module APIs
Page 28: Drupal Module APIs
Page 29: Drupal Module APIs
Page 30: Drupal Module APIs
Page 31: Drupal Module APIs
Page 32: Drupal Module APIs
Page 33: Drupal Module APIs
Page 34: Drupal Module APIs
Page 35: Drupal Module APIs
Page 36: Drupal Module APIs

hooks

Page 37: Drupal Module APIs

ac#vitystream_flickr.module

ac#vitystream.module

Page 38: Drupal Module APIs
Page 39: Drupal Module APIs

consolidated settings

Page 40: Drupal Module APIs

ac#vitystream_flickr.module

ac#vitystream.module

Page 41: Drupal Module APIs

ac#vitystream_flickr.module

ac#vitystream.module

Page 42: Drupal Module APIs

ac#vitystream_flickr.module

ac#vitystream.module

Page 43: Drupal Module APIs

ac#vitystream_flickr.module

ac#vitystream.module

Page 44: Drupal Module APIs

ac#vitystream.module

node.module

Page 45: Drupal Module APIs

ac#vitystream.module

node.module

Page 46: Drupal Module APIs

Security

Page 47: Drupal Module APIs
Page 48: Drupal Module APIs
Page 49: Drupal Module APIs
Page 50: Drupal Module APIs

validation

Page 51: Drupal Module APIs
Page 52: Drupal Module APIs
Page 53: Drupal Module APIs

Documentation

Page 54: Drupal Module APIs
Page 55: Drupal Module APIs
Page 56: Drupal Module APIs

Adam KalseyVP of [email protected]://workhabit.com/