Same filename and directory in other branches
- 9 core/modules/system/tests/modules/js_interaction_test/src/Controller/JSInteractionTestForm.php
Namespace
Drupal\js_interaction_test\Controller
File
core/modules/system/tests/modules/js_interaction_test/src/Controller/JSInteractionTestForm.php
View source
<?php
namespace Drupal\js_interaction_test\Controller;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
class JSInteractionTestForm extends FormBase {
public function getFormId() {
return __CLASS__;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
}
public function buildForm(array $form, FormStateInterface $form_state) {
return [
'target_link' => [
'#type' => 'link',
'#url' => Url::fromRoute('<current>'),
'#title' => $this
->t('Target link'),
],
'blocker_element' => [
'#type' => 'html_tag',
'#tag' => 'div',
'#attributes' => [
'class' => [
'blocker-element',
],
],
],
'remove_blocker_trigger' => [
'#type' => 'link',
'#url' => Url::fromRoute('<current>'),
'#title' => $this
->t('Remove Blocker Trigger'),
'#attributes' => [
'class' => [
'remove-blocker-trigger',
],
],
],
'target_field' => [
'#type' => 'textfield',
'#maxlength' => 20,
'#disabled' => TRUE,
],
'enable_field_trigger' => [
'#type' => 'link',
'#url' => Url::fromRoute('<current>'),
'#title' => $this
->t('Enable Field Trigger'),
'#attributes' => [
'class' => [
'enable-field-trigger',
],
],
],
'#attached' => [
'library' => [
'js_interaction_test/js_interaction_test',
],
],
];
}
}
Classes