drupal - 如何获取当前drupal主题的路径?

标签 drupal drupal-6 drupal-theming

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/

相关文章:

javascript - Drupal:Ajax 发布出现内部服务器错误

php - fatal error : Call to undefined function media_include_browser_js()

php - 如何在 MySQL 数据库中全局更改字符串

php - Drupal 查询未更新

linux - 在重定向时,重定向的页面是否得到处理?

performance - 关于加速 Drupal 站点的提示

html - 发送 HTML 电子邮件

Drupal 7 : Hiding labels with empty fields when viewing a node

javascript - 如何在 Drupal 7 中订购 javascript 文件以加载 Foundation 5

drupal-8 - Drupal - Ajax 验证仅在我连接时有效