-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNemidFirstName.php
More file actions
64 lines (56 loc) · 1.83 KB
/
Copy pathNemidFirstName.php
File metadata and controls
64 lines (56 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Drupal\os2forms_nemid\Element;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a 'os2forms_nemid_first_name'.
*
* @FormElement("os2forms_nemid_first_name")
*
* @see \Drupal\Core\Render\Element\FormElement
* @see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21FormElement.php/class/FormElement
* @see \Drupal\Core\Render\Element\RenderElement
* @see https://api.drupal.org/api/drupal/namespace/Drupal%21Core%21Render%21Element
* @see \Drupal\os2forms_nemid\Element\NemidFirstName
*/
class NemidFirstName extends NemidElementBase {
/**
* {@inheritdoc}
*/
public function getInfo() {
$class = get_class($this);
return parent::getInfo() + [
'#process' => [
[$class, 'processNemidFirstName'],
[$class, 'processAjaxForm'],
],
'#element_validate' => [
[$class, 'validateNemidFirstName'],
],
'#pre_render' => [
[$class, 'preRenderNemidFirstName'],
],
'#theme' => 'input__os2forms_nemid_first_name',
];
}
/**
* Processes a 'os2forms_nemid_first_name' element.
*/
public static function processNemidFirstName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add and manipulate your element's properties and callbacks.
return $element;
}
/**
* Webform element validation handler for #type 'os2forms_nemid_first_name'.
*/
public static function validateNemidFirstName(&$element, FormStateInterface $form_state, &$complete_form) {
// Here you can add custom validation logic.
}
/**
* {@inheritdoc}
*/
public static function preRenderNemidFirstName(array $element) {
$element = parent::prerenderNemidElementBase($element);
static::setAttributes($element, ['form-text', 'os2forms-nemid-first-name']);
return $element;
}
}