You are here

public static function YamlFormCreditCardNumber::preRenderYamlFormCreditCardNumber in YAML Form 8

Prepares a #type 'creditcard_number' render element for theme_element().

Parameters

array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes.

Return value

array The $element with prepared variables ready for theme_element().

File

src/Element/YamlFormCreditCardNumber.php, line 115

Class

YamlFormCreditCardNumber
Provides a form element for entering a credit card number.

Namespace

Drupal\yamlform\Element

Code

public static function preRenderYamlFormCreditCardNumber($element) {
  $element['#attributes']['type'] = 'text';
  Element::setAttributes($element, [
    'id',
    'name',
    'value',
    'size',
    'maxlength',
    'placeholder',
  ]);
  static::setAttributes($element, [
    'form-textfield',
    'form-creditcard-number',
  ]);
  return $element;
}