You are here

function module_builder_get_path in Module Builder 7

Same name and namespace in other branches
  1. 6.2 includes/common.inc \module_builder_get_path()

Get a path to a resource that is safe to use either on Drupal or Drush.

Parameters

$subpath: The subpath inside the module_builder folder. Eg, 'templates'.

2 calls to module_builder_get_path()
module_builder_get_templates in includes/generate.inc
Helper function for module_builder_generate_module
module_builder_include in includes/common.inc
Include a version-specific file whether we're on drush or drupal. That is, we first try to include a file called NAME_X.inc where X is a Drupal major version number before falling back to NAME.inc.

File

includes/common.inc, line 30
common.inc Stuff needed both by module and drush command.

Code

function module_builder_get_path($subpath) {
  $mb_path = drupal_get_path('module', 'module_builder');
  if (!$mb_path) {
    $mb_path = dirname(__FILE__) . '/..';
  }
  $path = $mb_path . '/' . $subpath;

  //print "path: >>$path<<";
  return $path;
}