1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: */
11:
12: namespace Nette\Forms;
13:
14: use Nette;
15:
16:
17:
18: /**
19: * Defines method that must be implemented to allow a component to act like a form control.
20: *
21: * @author David Grudl
22: */
23: interface IFormControl
24: {
25:
26: /**
27: * Loads HTTP data.
28: * @return void
29: */
30: function loadHttpData();
31:
32: /**
33: * Sets control's value.
34: * @param mixed
35: * @return void
36: */
37: function setValue($value);
38:
39: /**
40: * Returns control's value.
41: * @return mixed
42: */
43: function getValue();
44:
45: /**
46: * @return Rules
47: */
48: function getRules();
49:
50: /**
51: * Returns errors corresponding to control.
52: * @return array
53: */
54: function getErrors();
55:
56: /**
57: * Is control disabled?
58: * @return bool
59: */
60: function isDisabled();
61:
62: /**
63: * Returns translated string.
64: * @param string
65: * @param int plural count
66: * @return string
67: */
68: function translate($s, $count = NULL);
69:
70: }
71: