Get the path to a Drupal module or theme

This is a very useful function in Drupal’s API that is hard to find searching online for file system paths to Drupal modules or themes or anything like that.

So to get the path to a Drupal module or theme it’s as simple as:

<?php
drupal_get_path('module', $module_name);
?>

or:

<?php
drupal_get_path('theme', $theme_name);
?>

http://api.drupal.org/api/function/drupal_get_path/5

Advertisements

2 Comments

  1. July 4, 2010 at 2:44 am

    […] Get the path to a Drupal module or theme (scvinodkumar.wordpress.com) […]

  2. Riyaz said,

    August 30, 2010 at 4:52 pm

    Please tell me how to create custom drupla module?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: