-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormViewInstantiatorInterface.php
More file actions
32 lines (28 loc) · 1.1 KB
/
Copy pathFormViewInstantiatorInterface.php
File metadata and controls
32 lines (28 loc) · 1.1 KB
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
26
27
28
29
30
31
32
<?php
namespace Quatrevieux\Form\View;
use Quatrevieux\Form\Validator\FieldError;
/**
* Type for instantiate the form view object
*/
interface FormViewInstantiatorInterface
{
/**
* Create the default form view object
* This method is used when the form is not submitted nor imported
*
* @param string|null $rootField In case of embedded form, define a root HTTP field which will be used as prefix on sub-fields (e.g. "user[address]"). Use null for a root form.
*
* @return FormView
*/
public function default(?string $rootField = null): FormView;
/**
* Create the form view object from the submitted data and errors
*
* @param mixed[] $value Submitted HTTP data
* @param array<array-key, FieldError|mixed[]> $errors Fields errors
* @param string|null $rootField In case of embedded form, define a root HTTP field which will be used as prefix on sub-fields (e.g. "user[address]"). Use null for a root form.
*
* @return FormView
*/
public function submitted(array $value, array $errors, ?string $rootField = null): FormView;
}