如何获得所有可用实体视图模式的列表?


Answers:


13

我认为您正在谈论实体的视图模式。

$entity_info = entity_get_info('node');
debug(array_keys($entity_info['view modes']));

结果将是

array (
  0 => 'full',
  1 => 'teaser',
  2 => 'rss',
  3 => 'search_index',
  4 => 'search_result',
)

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.