1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Forms;
9:
10:
11: /**
12: * Defines method that must be implemented to allow a component to act like a form control.
13: *
14: * @author David Grudl
15: */
16: interface IControl
17: {
18:
19: /**
20: * Sets control's value.
21: * @param mixed
22: * @return void
23: */
24: function setValue($value);
25:
26: /**
27: * Returns control's value.
28: * @return mixed
29: */
30: function getValue();
31:
32: /**
33: * @return void
34: */
35: function validate();
36:
37: /**
38: * Returns errors corresponding to control.
39: * @return array
40: */
41: function getErrors();
42:
43: /**
44: * Is control value excluded from $form->getValues() result?
45: * @return bool
46: */
47: function isOmitted();
48:
49: /**
50: * Returns translated string.
51: * @param string
52: * @param int plural count
53: * @return string
54: */
55: function translate($s, $count = NULL);
56:
57: }
58: