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 http://nettephp.com
  12. 12:  *
  13. 13:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  14. 14:  * @license    http://nettephp.com/license  Nette license
  15. 15:  * @link       http://nettephp.com
  16. 16:  * @category   Nette
  17. 17:  * @package    Nette\Forms
  18. 18:  */
  19. 19:  
  20. 20:  
  21. 21:  
  22. 22: /**
  23. 23:  * Defines method that must be implemented to allow a component to act like a form control.
  24. 24:  *
  25. 25:  * @author     David Grudl
  26. 26:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  27. 27:  * @package    Nette\Forms
  28. 28:  */
  29. 29: interface IFormControl
  30. 30: {
  31. 31:  
  32. 32:     /**
  33. 33:      * Loads HTTP data.
  34. 34:      * @return void 
  35. 35:      */
  36. 36:     function loadHttpData();
  37. 37:  
  38. 38:     /**
  39. 39:      * Sets control's value.
  40. 40:      * @param  mixed 
  41. 41:      * @return void 
  42. 42:      */
  43. 43:     function setValue($value);
  44. 44:  
  45. 45:     /**
  46. 46:      * Returns control's value.
  47. 47:      * @return mixed 
  48. 48:      */
  49. 49:     function getValue();
  50. 50:  
  51. 51:     /**
  52. 52:      * @return Rules 
  53. 53:      */
  54. 54:     function getRules();
  55. 55:  
  56. 56:     /**
  57. 57:      * Returns errors corresponding to control.
  58. 58:      * @return array 
  59. 59:      */
  60. 60:     function getErrors();
  61. 61:  
  62. 62:     /**
  63. 63:      * Is control disabled?
  64. 64:      * @return bool 
  65. 65:      */
  66. 66:     function isDisabled();
  67. 67:  
  68. 68:     /**
  69. 69:      * Returns translated string.
  70. 70:      * @param  string 
  71. 71:      * @return string 
  72. 72:      */
  73. 73:     function translate($s);
  74. 74:  
  75. 75: }