You are here

Accesskey.php in Linkit 8.4

File

src/Plugin/Linkit/Attribute/Accesskey.php
View source
<?php

/**
 * @file
 * Contains \Drupal\linkit\Plugin\Linkit\Attribute\Accesskey.
 */
namespace Drupal\linkit\Plugin\Linkit\Attribute;

use Drupal\linkit\AttributeBase;

/**
 * Accesskey attribute.
 *
 * @Attribute(
 *   id = "accesskey",
 *   label = @Translation("Accesskey"),
 *   html_name = "accesskey",
 *   description = @Translation("Basic input field for the accesskey attribute.")
 * )
 */
class Accesskey extends AttributeBase {

  /**
   * {@inheritdoc}
   */
  public function buildFormElement($default_value) {
    return [
      '#type' => 'textfield',
      '#title' => t('Accesskey'),
      '#default_value' => $default_value,
      '#maxlength' => 255,
      '#size' => 40,
      '#placeholder' => t('The "accesskey" attribute value'),
    ];
  }

}

Classes

Namesort descending Description
Accesskey Accesskey attribute.