-<!-- @file Documentation for the @BootstrapAlter annotated discovery plugin. -->
+<!-- @file Documentation for the @BootstrapAlter annotated plugin. -->
<!-- @defgroup -->
<!-- @ingroup -->
# @BootstrapAlter
alter function name and parameters as arguments:
```php
+<?php
use Drupal\bootstrap\Bootstrap;
/**
- * Implements hook_some_hook_alter().
+ * Implements hook_HOOK_alter().
*/
-function THEMENAME_some_hook_alter(&$data, &$context1 = NULL, &$context2 = NULL) {
+function hook_some_hook_alter(&$data, &$context1 = NULL, &$context2 = NULL) {
Bootstrap::alter(__FUNCTION__, $data, $context1, $context2);
}
+?>
```
## Supported alter hooks {#supported}
@link plugins_form @BootstrapForm @endlink
-While, yes technically, `hook_form_system_theme_settings_alter` could also
-fall under the form plugin, we decided to take those a step further as well, see:
+While, yes technically, `hook_form_system_theme_settings_alter` could also fall
+under the form plugin, we decided to take those a step further as well, see:
@link plugins_setting @BootstrapSetting @endlink
following contents:
```php
+<?php
/**
* @file
* Contains \Drupal\THEMENAME\Plugin\Alter\PageAttachments.
namespace Drupal\THEMENAME\Plugin\Alter;
-use Drupal\bootstrap\Annotation\BootstrapAlter;
+use Drupal\bootstrap\Plugin\Alter\PageAttachments as BootstrapPageAttachements;
/**
* Implements hook_page_attachments_alter().
*
* @BootstrapAlter("page_attachments")
*/
-class PageAttachments extends \Drupal\bootstrap\Plugin\Alter\PageAttachments {
+class PageAttachments extends BootstrapPageAttachements {
/**
* {@inheritdoc}
}
}
+?>
```
## Rebuild the cache {#rebuild}