Drupal API 有 drupal_get_path($type, $name)
这将给出任何特定主题或模块的路径。如果我想要当前主题的路径怎么办?
最佳答案
在 Drupal 8 中,如果您需要在激活管理主题时获取事件主题路径,您可以获取默认主题路径:
$themeHandler = \Drupal::service('theme_handler');
$themePath = $themeHandler->getTheme($themeHandler->getDefault())->getPath();
关于drupal - 如何获取当前drupal主题的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/303761/