class Messages in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/area/Messages.php \Drupal\views\Plugin\views\area\Messages
- 9 core/modules/views/src/Plugin/views/area/Messages.php \Drupal\views\Plugin\views\area\Messages
Provides an area for messages.
Plugin annotation
@ViewsArea("messages");
Hierarchy
- class \Drupal\views\Plugin\views\area\AreaPluginBase extends \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\area\Messages
Expanded class hierarchy of Messages
Related topics
1 file declares its use of Messages
- MessagesTest.php in core/
modules/ views/ tests/ src/ Unit/ Plugin/ area/ MessagesTest.php
2 string references to 'Messages'
- hook_toolbar in core/
modules/ toolbar/ toolbar.api.php - Add items to the toolbar menu.
- views_views_data in core/
modules/ views/ views.views.inc - Implements hook_views_data().
File
- core/
modules/ views/ src/ Plugin/ views/ area/ Messages.php, line 12
Namespace
Drupal\views\Plugin\views\areaView source
class Messages extends AreaPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
// Set the default to TRUE so it shows on empty pages by default.
$options['empty']['default'] = TRUE;
return $options;
}
/**
* {@inheritdoc}
*/
public function render($empty = FALSE) {
if (!$empty || !empty($this->options['empty'])) {
return [
'#type' => 'status_messages',
];
}
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AreaPluginBase:: |
public | property | The type of this area handler, i.e. 'header', 'footer', or 'empty'. | |
AreaPluginBase:: |
public | function | ||
AreaPluginBase:: |
public | function | 7 | |
AreaPluginBase:: |
public | function | Overrides Drupal\views\Plugin\views\HandlerBase::init(). | 1 |
AreaPluginBase:: |
public | function | Does that area have nothing to show. | 1 |
AreaPluginBase:: |
public | function | Performs any operations needed before full rendering. | 1 |
AreaPluginBase:: |
public | function | ||
Messages:: |
protected | function |
Overrides AreaPluginBase:: |
|
Messages:: |
public | function |
Render the area. Overrides AreaPluginBase:: |