Interim commit.
[yaffs-website] / web / modules / contrib / environment_indicator / src / Element / EnvironmentIndicator.php
1 <?php
2
3 namespace Drupal\environment_indicator\Element;
4
5 use Drupal\Core\Render\Element\Container;
6
7 /**
8  * Provides a render element to add the environment indicator to the page.
9  *
10  * Usage example:
11  * @code
12  * $page_top['indicator'] = [
13  *   '#type' => 'environment_indicator',
14  *   '#title' => t('Acceptance'),
15  *   '#description' => t('Sprint 9'),
16  *   '#attributes' => ['class' => 'custom-class'],
17  *   '#fg_color' => '#123412',
18  *   '#bg_color' => 'FEDCBA9',
19  * ];
20  * @endcode
21  *
22  * @RenderElement("environment_indicator")
23  */
24 class EnvironmentIndicator extends Container {
25
26   /**
27    * {@inheritdoc}
28    */
29   public function getInfo() {
30     $info = parent::getInfo();
31     $info['#theme_wrappers'][] = 'environment_indicator';
32     return $info;
33   }
34
35 }