protected function ViewsReferenceItem::getAllViewsNames in Views Reference Field 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldType/ViewsReferenceItem.php \Drupal\viewsreference\Plugin\Field\FieldType\ViewsReferenceItem::getAllViewsNames()
Get all enabled view names.
Return value
array An array of enabled view names keyed by view ID.
1 call to ViewsReferenceItem::getAllViewsNames()
- ViewsReferenceItem::fieldSettingsForm in src/
Plugin/ Field/ FieldType/ ViewsReferenceItem.php - Returns a form for the field-level settings.
File
- src/
Plugin/ Field/ FieldType/ ViewsReferenceItem.php, line 173
Class
- ViewsReferenceItem
- Defines the 'viewsreference' entity field type.
Namespace
Drupal\viewsreference\Plugin\Field\FieldTypeCode
protected function getAllViewsNames() {
$views = Views::getEnabledViews();
$options = [];
foreach ($views as $view) {
$options[$view
->get('id')] = $view
->get('label');
}
return $options;
}