📜  drupal 8 建议 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:27.737000             🧑  作者: Mango

代码示例1
function MYMODULE_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  if (\Drupal::currentUser()
    ->isAuthenticated() && in_array($hook, array(
    'node',
    'taxonomy_term',
  ))) {
    $suggestions[] = $hook . '__' . 'logged_in';
  }
}