PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.21
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.21
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 / CustomHtml.php

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

33 lines 1.1 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\Framework\Helpers\ArrayHelper;
6
7 class CustomHtml extends BaseComponent
8 {
9 /**
10 * Compile and echo the html element
11 * @param array $data [element data]
12 * @param stdClass $form [Form Object]
13 * @return viod
14 */
15 public function compile($data, $form)
16 {
17 $elementName = $data['element'];
18 $data = apply_filters('fluenform_rendering_field_data_'.$elementName, $data, $form);
19
20 $hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';
21 $cls = trim($this->getDefaultContainerClass() .' '.$hasConditions);
22 if($containerClass = ArrayHelper::get($data, 'settings.container_class')) {
23 $cls .= ' '.$containerClass;
24 }
25 $atts = $this->buildAttributes(
26 \FluentForm\Framework\Helpers\ArrayHelper::except($data['attributes'], 'name')
27 );
28 $html = "<div class='{$cls}' {$atts}>{$data['settings']['html_codes']}</div>";
29 $html = apply_filters('fluenform_rendering_field_html_'.$elementName, $html, $data, $form);
30 echo $html;
31 }
32 }
33