Skip to content

Latest commit

 

History

History
97 lines (65 loc) · 3.22 KB

README.markdown

File metadata and controls

97 lines (65 loc) · 3.22 KB

Introduction

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

Features

  • 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

Installation

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:

variablevalue
TM_DRUPAL_VERSION6

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:

variablevalue
TM_DRUPAL_APIhttp://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:

variablevalue
TM_DRUPAL_APIhttp://drupalcontrib.org

Usage

Hooks

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⇥

Resources