Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / themes / contrib / bootstrap / docs / plugins / Process.md
index 432f6bb9b078a2d0dbd0309842cae99ce27f4218..6aa9bf59b4c66bf6132b44617ecd1bd53773ef49 100644 (file)
@@ -1,4 +1,4 @@
-<!-- @file Documentation for the @BootstrapProcess annotated discovery plugin. -->
+<!-- @file Documentation for the @BootstrapProcess annotated plugin. -->
 <!-- @defgroup -->
 <!-- @ingroup -->
 # @BootstrapProcess
@@ -29,14 +29,11 @@ Create a file at `./THEMENAME/src/Plugin/Process/TextFormat.php` with the
 following contents:
 
 ```php
-/**
- * @file
- * Contains \Drupal\THEMENAME\Plugin\Process\TextFormat.
- */
+<?php
 
 namespace Drupal\THEMENAME\Plugin\Process;
 
-use Drupal\bootstrap\Annotation\BootstrapProcess;
+use Drupal\bootstrap\Plugin\Process\TextFormat as BootstrapTextFormat;
 use Drupal\bootstrap\Utility\Element;
 use Drupal\Core\Form\FormStateInterface;
 
@@ -49,11 +46,12 @@ use Drupal\Core\Form\FormStateInterface;
  *
  * @see \Drupal\filter\Element\TextFormat::processFormat()
  */
-class TextFormat extends \Drupal\bootstrap\Plugin\Process\TextFormat {
-
-  // It should be noted that you do not need both methods here.
-  // This is to just show you the different examples of how this plugin
-  // works and how it can be tailored to your needs.
+class TextFormat extends BootstrapTextFormat {
+  /*
+   * It should be noted that you do not need both methods here.
+   * This is to just show you the different examples of how this plugin
+   * works and how it can be tailored to your needs.
+   */
 
   /**
    * {@inheritdoc}
@@ -66,9 +64,10 @@ class TextFormat extends \Drupal\bootstrap\Plugin\Process\TextFormat {
 
     // Technically this isn't the method that we need to achieve our goal.
     // But showing it just for example sake.
-
-    // You must always return the element in this method, as well as call
-    // the parent method when sub-classing this method, it invokes processElement();
+    //
+    // You must always return the element in this method, as well as call the
+    // parent method when sub-classing this method as it is used to invoke
+    // static::processElement();
     return parent::process($element, $form_state, $complete_form);
   }
 
@@ -79,10 +78,11 @@ class TextFormat extends \Drupal\bootstrap\Plugin\Process\TextFormat {
     // Normally, we'd call the parent method here. But this is actually an
     // instance where we know we don't want to use the alterations made by
     // the base theme. So we just comment it out and leave the method empty.
-    // parent::processElement($element, $form_state, $complete_form);
+    // parent::processElement($element, $form_state, $complete_form);.
   }
 
 }
+?>
 ```
 
 ## Rebuild the cache {#rebuild}
@@ -95,4 +95,5 @@ To rebuild your cache, navigate to `admin/config/development/performance` and
 click the `Clear all caches` button. Or if you prefer, run `drush cr` from the
 command line.
 
-VoilĂ ! After this, you should have a fully functional `@BootstrapProcess` plugin!
+VoilĂ ! After this, you should have a fully functional `@BootstrapProcess`
+plugin!