Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / metatag / src / Plugin / metatag / Tag / Description.php
1 <?php
2
3 namespace Drupal\metatag\Plugin\metatag\Tag;
4
5 /**
6  * The basic "Description" meta tag.
7  *
8  * @MetatagTag(
9  *   id = "description",
10  *   label = @Translation("Description"),
11  *   description = @Translation("A brief and concise summary of the page's content, preferably 320 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results."),
12  *   name = "description",
13  *   group = "basic",
14  *   weight = 2,
15  *   type = "label",
16  *   secure = FALSE,
17  *   multiple = FALSE
18  * )
19  */
20 class Description extends MetaNameBase {
21
22   /**
23    * Generate a form element for this meta tag.
24    */
25   public function form(array $element = []) {
26     $form = [
27       '#type' => 'textarea',
28       '#title' => $this->label(),
29       '#default_value' => $this->value(),
30       '#row' => 2,
31       '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
32       '#description' => $this->description(),
33       '#element_validate' => [[get_class($this), 'validateTag']],
34     ];
35     return $form;
36   }
37
38 }