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 / Container.php

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

62 lines 1.7 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 Container extends BaseComponent
8 {
9 /**
10 * Max columns for container
11 * @var integer
12 */
13 protected $maxColumns = 12;
14
15 /**
16 * Container column class
17 * @var string
18 */
19 protected $columnClass = 'ff-t-cell';
20
21 /**
22 * Container wrapper class
23 * @var string
24 */
25 protected $wrapperClass = 'ff-t-container ff-column-container';
26
27 /**
28 * Compile and echo the html element
29 * @param array $data [element data]
30 * @param stdClass $form [Form Object]
31 * @return viod
32 */
33 public function compile($data, $form)
34 {
35 $elementName = $data['element'];
36 $data = apply_filters('fluenform_rendering_field_data_'.$elementName, $data, $form);
37
38 $containerClass = ArrayHelper::get($data, 'settings.container_class');
39
40 $conatiner_css_class = $this->wrapperClass.' ff_columns_total_'.count($data['columns']);
41 if($containerClass) {
42 $conatiner_css_class = $conatiner_css_class.' '.strip_tags($containerClass);
43 }
44
45 $columnClass = $this->columnClass;
46 echo "<div class='".$conatiner_css_class."'>";
47 if (isset($data['settings']['label'])) {
48 echo "<strong>{$data['settings']['label']}</strong>";
49 }
50 foreach ($data['columns'] as $columnIndex => $column) {
51 $newColumnClass = $columnClass.' ff-t-column-'.($columnIndex + 1);
52 echo "<div class='{$newColumnClass}'>";
53 foreach ($column['fields'] as $item) {
54 $item = apply_filters('fluentform_before_render_item', $item, $form);
55 do_action('fluentform_render_item_'.$item['element'], $item, $form);
56 }
57 echo "</div>";
58 }
59 echo "</div>";
60 }
61 }
62