PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 4.3.18
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v4.3.18
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / FormBuilder / Components / TextArea.php

TextArea.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 4.3.18, at app/Services/FormBuilder/Components/TextArea.php

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Services\FormBuilder\Components;
4
5 use FluentForm\App\Helpers\Helper;
6
7 class TextArea extends BaseComponent
8 {
9 /**
10 * Compile and echo the html element
11 *
12 * @param array $data [element data]
13 * @param \stdClass $form [Form Object]
14 *
15 * @return void
16 */
17 public function compile($data, $form)
18 {
19 $elementName = $data['element'];
20 $data = apply_filters('fluentform_rendering_field_data_' . $elementName, $data, $form);
21
22 $textareaValue = $this->extractValueFromAttributes($data);
23
24 $data['attributes']['class'] = trim('ff-el-form-control ' . $data['attributes']['class']);
25 $data['attributes']['id'] = $this->makeElementId($data, $form);
26
27 if ($tabIndex = Helper::getNextTabIndex()) {
28 $data['attributes']['tabindex'] = $tabIndex;
29 }
30
31 $elMarkup = '<textarea %s>%s</textarea>';
32
33 $atts = $this->buildAttributes($data['attributes']);
34
35 $elMarkup = sprintf(
36 $elMarkup,
37 $atts,
38 esc_attr($textareaValue)
39 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
40
41 $html = $this->buildElementMarkup($elMarkup, $data, $form);
42
43 $this->printContent('fluentform_rendering_field_html_' . $elementName, $html, $data, $form);
44 }
45 }
46