📜  drupal 9 从视图中删除字段 - PHP 代码示例

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

代码示例1
// use this hook to remove fields because this fires before the
// query, but after the display is loaded.  therefore, it's a simple
// field unset.  dump $view->getDisplay() to see what's loaded.

function mymod_views_pre_build(ViewExecutable $view) {
    unset($view->field['name']);
}