Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (65 sloc) 3.22 KB


The PHP Drupal bundle provides Drupal developers with shortcuts for creating Drupal modules and themes.


  • FAPI controls and elements
  • Menu items
  • Theme functions (incomplete)
  • Hooks (incomplete)
  • Devel debugging functions (dpm, dpr, dvm, dvr)
  • Views debugging functions (vpr, views_trace, views_var_export, etc)
  • Useful snippets (if node, l(), t())
  • Simpletest
  • Preprocess functions
  • Automatic detection of Drupal version when .info file available
  • Drupal 5 and 6 supported
  • Snippet building commands - makes it easier to contribute more snippets!

Planned features...

  • Add more hooks
  • Add more theme functions
  • Default template files


There are 2 Shell Variables which should be set for this bundle. Shell Variables may be set up using TextMate => Preferences => Advanced => Shell Variables.

Drupal version:

The bundle automatically detects which version of Drupal you are using by checking the .info files of the project you are currently working with. It is a good idea to set up a fallback for cases where you are not using a project or something fails.

Set the following Shell Variable:


You can change this variable when switching between projects or alternatively you may wish to set up a Project Dependent Variable.

API location:

The Documentation for Word command performs a documentation lookup for any Drupal functions.

Set the following Shell Variable:


Using will only give you reference documentation for Drupal core functions. If you wish to be able to receive reference documentation for most of Drupal's contributed modules then use the following settings instead:




A number of Drupal hooks have been implemented as tab triggers. Try the following:

<?php hook_help⇥

Tab stops have been used throughout the snippets to make it easier to edit the inserted code. Try pressing tab a few times to step through code. Once you hit the bottom tab stop you will break the flow and won't be able to reverse tab back through the tab stops.

FAPI Form Controls

Form control snippets have been added for easy form generation. Try the following:

<?php $form['my_form'] = checkboxes⇥

Again, tab stops have been used to allow you to edit the details. Try tabbing though.

FAPI Elements

Adding more elements to the form is easy. Try the following:

<?php \#description⇥