Book Image

Learning Drupal 6 Module Development

Book Image

Learning Drupal 6 Module Development

Overview of this book

Table of Contents (14 chapters)
Learning Drupal 6 Module Development
Credits
About the Author
About the Reviewers
Preface

Getting Started


Our new module will be called sitenews, and will be stored in the drupal/sites/all/modules/sitenews directory.

Citing Dependencies in the .info File

While the .info files we've been using differ only in name and description, here we will make use of a new field.

; $Id$
name = "Site News"
description = "Send an email message of site news to all users."
core = 6.x
php = 5.1
dependencies[] = "trigger"

The sitenews.info file should look largely familiar. The last line is the only one with a new directive.

This last line is used to indicate what dependencies a modules has. That is, it tells Drupal which other modules must be installed before this module can function appropriately.

Since it is not uncommon for a module to have multiple dependencies, the dependencies directive is multi-valued. As we saw in Chapter 2, its syntax is basically like that of a PHP array assignment:

dependencies[] = "trigger"

If we need to add a second dependency, we would simply add another similar line...