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:      * @param  array 
  35. 35:      * @return void 
  36. 36:      */
  37. 37:     function loadHttpData($data);
  38. 38:  
  39. 39:     /**
  40. 40:      * Sets control's value.
  41. 41:      * @param  mixed 
  42. 42:      * @return void 
  43. 43:      */
  44. 44:     function setValue($value);
  45. 45:  
  46. 46:     /**
  47. 47:      * Returns control's value.
  48. 48:      * @return mixed 
  49. 49:      */
  50. 50:     function getValue();
  51. 51:  
  52. 52:     /**
  53. 53:      * @return Rules 
  54. 54:      */
  55. 55:     function getRules();
  56. 56:  
  57. 57:     /**
  58. 58:      * Returns errors corresponding to control.
  59. 59:      * @return array 
  60. 60:      */
  61. 61:     function getErrors();
  62. 62:  
  63. 63:     /**
  64. 64:      * Is control disabled?
  65. 65:      * @return bool 
  66. 66:      */
  67. 67:     function isDisabled();
  68. 68:  
  69. 69:     /**
  70. 70:      * Returns translated string.
  71. 71:      * @param  string 
  72. 72:      * @return string 
  73. 73:      */
  74. 74:     function translate($s);
  75. 75:  
  76. 76: }