Source for file IFormControl.php

Documentation is available at IFormControl.php

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