PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.31
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.31
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 3.6.31, at app/Services/FormBuilder/Components/TextArea.php

39 lines 1.2 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 class TextArea extends BaseComponent
6 {
7 /**
8 * Compile and echo the html element
9 * @param array $data [element data]
10 * @param \stdClass $form [Form Object]
11 * @return void
12 */
13 public function compile($data, $form)
14 {
15 $elementName = $data['element'];
16 $data = apply_filters('fluenform_rendering_field_data_'.$elementName, $data, $form);
17
18 $textareaValue = $this->extractValueFromAttributes($data);
19
20 $data['attributes']['class'] = trim('ff-el-form-control '.$data['attributes']['class']);
21 $data['attributes']['id'] = $this->makeElementId($data, $form);
22
23 if($tabIndex = \FluentForm\App\Helpers\Helper::getNextTabIndex()) {
24 $data['attributes']['tabindex'] = $tabIndex;
25 }
26
27 $elMarkup = '<textarea %s>%s</textarea>';
28
29 $elMarkup = sprintf(
30 $elMarkup,
31 $this->buildAttributes($data['attributes']),
32 $textareaValue
33 );
34
35 $html = $this->buildElementMarkup($elMarkup, $data, $form);
36 echo apply_filters('fluenform_rendering_field_html_'.$elementName, $html, $data, $form);
37 }
38 }
39