1: <?php
2:
3: namespace Charcoal\Ui\Form;
4:
5: /**
6: * Defines a form.
7: */
8: interface FormInterface
9: {
10: /**
11: * @param string $action The form action, typically a URL.
12: * @return FormInterface Chainable
13: */
14: public function setAction($action);
15:
16: /**
17: * @return string
18: */
19: public function action();
20:
21: /**
22: * @param string $method Either "post" or "get".
23: * @return FormInterface Chainable
24: */
25: public function setMethod($method);
26:
27: /**
28: * @return string Either "post" or "get"
29: */
30: public function method();
31:
32: /**
33: * @param string $mode The l10n mode.
34: * @return FormGroupInterface Chainable
35: */
36: public function setL10nMode($mode);
37:
38: /**
39: * @return string
40: */
41: public function l10nMode();
42:
43: /**
44: * @param array $data The (pre-populated) form data.
45: * @return FormInterface Chainable
46: */
47: public function setFormData(array $data);
48:
49: /**
50: * @param string $key The form data key, or property identifier.
51: * @param mixed $val The form data value, for a given key.
52: * @return FormInterface Chainable
53: */
54: public function addFormData($key, $val);
55:
56: /**
57: * @return array
58: */
59: public function formData();
60: }
61: