drupal_load
includes/bootstrap.inc, строка 539
- Версии
- 5 – 6
drupal_load($type, $name)
Includes a file with the provided type and name. This prevents including a theme, engine, module, etc., more than once.
Параметры
$type
The type of item to load (i.e. theme, theme_engine, module).
$name
The name of the item to load.
Возвращаемое значение
TRUE
if the item is loaded or has already been loaded.
Код
<?php
function drupal_load($type, $name) {
static $files = array();
if (isset($files[$type][$name])) {
return TRUE;
}
$filename = drupal_get_filename($type, $name);
if ($filename) {
include_once "./$filename";
$files[$type][$name] = TRUE;
return TRUE;
}
return FALSE;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии