blob: c4076044f64d199928a444cf7f5f20695aef197f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php
namespace FlatFileForms\Controllers;
use FlatFileForms\Builder;
class FieldsController
{
public function getFields(Builder $builder): array
{
/**@var Utilities $utilities*/
global $utilities;
$fields = $builder->buildFields($_GET['page'] ?? null);
// flatten paged form
if ($utilities->isPagedFieldSet($fields) && isset($_GET['flat'])) {
$fields = array_merge(...array_values($fields));
}
$content['data'] = $fields;
return $content;
}
}
|