function Views::getPluginTypes
Same name in other branches
- 9 core/modules/views/src/Views.php \Drupal\views\Views::getPluginTypes()
- 8.9.x core/modules/views/src/Views.php \Drupal\views\Views::getPluginTypes()
- 11.x core/modules/views/src/Views.php \Drupal\views\Views::getPluginTypes()
Returns a list of plugin types.
Parameters
string $type: (optional) filter the list of plugins by type. Available options are 'plugin' or 'handler'.
Return value
array An array of plugin types.
3 calls to Views::getPluginTypes()
- DisplayPluginBase::calculateCacheMetadata in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - Calculates the display's cache metadata by inspecting each handler/plugin.
- DisplayPluginBase::getAllPlugins in core/
modules/ views/ src/ Plugin/ views/ display/ DisplayPluginBase.php - Gets all the plugins used by the display.
- ViewExecutable::getPluginTypes in core/
modules/ views/ src/ ViewExecutable.php - Returns the valid types of plugins that can be used.
File
-
core/
modules/ views/ src/ Views.php, line 513
Class
- Views
- Static service container wrapper for views.
Namespace
Drupal\viewsCode
public static function getPluginTypes($type = NULL) {
if ($type === NULL) {
return array_keys(static::$plugins);
}
if (!in_array($type, [
'plugin',
'handler',
])) {
throw new \Exception('Invalid plugin type used. Valid types are "plugin" or "handler".');
}
return array_keys(array_filter(static::$plugins, function ($plugin_type) use ($type) {
return $plugin_type == $type;
}));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.