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: use Nette;
11:
12:
13: /**
14: * Defines method that must be implemented to allow a component to act like a form control.
15: *
16: * @author David Grudl
17: */
18: interface IControl
19: {
20:
21: /**
22: * Sets control's value.
23: * @param mixed
24: * @return void
25: */
26: function setValue($value);
27:
28: /**
29: * Returns control's value.
30: * @return mixed
31: */
32: function getValue();
33:
34: /**
35: * @return void
36: */
37: function validate();
38:
39: /**
40: * Returns errors corresponding to control.
41: * @return array
42: */
43: function getErrors();
44:
45: /**
46: * Is control value excluded from $form->getValues() result?
47: * @return bool
48: */
49: function isOmitted();
50:
51: /**
52: * Returns translated string.
53: * @param string
54: * @param int plural count
55: * @return string
56: */
57: function translate($s, $count = NULL);
58:
59: }
60: