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
.
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:
variable | value |
---|---|
TM_DRUPAL_VERSION | 6 |
You can change this variable when switching between projects or alternatively you may wish to set up a Project Dependent Variable.
The Documentation for Word
command performs a documentation lookup for any Drupal functions.
Set the following Shell Variable:
variable | value |
---|---|
TM_DRUPAL_API | http://api.drupal.org |
Using api.drupal.org 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:
variable | value |
---|---|
TM_DRUPAL_API | http://drupalcontrib.org |
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.
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.
Adding more elements to the form is easy. Try the following:
<?php
\#description⇥
- Drupal Textmate project - Bug reports, feature requests and patches welcome.
- Drupal IDE group - General discussion