phpDocumentor table
[ class tree: table ] [ index: table ] [ all elements ]

Source for file Tr.php

Documentation is available at Tr.php

  1. <?
  2. /**
  3. * @package table
  4. * @filesource
  5. * @see HTML_TABLE_COMPONENT_PATH.'/Tr.php'
  6. * @copyright (c) http://Finn-Rasmussen.com
  7. * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
  8. * @author http://Finn-Rasmussen.com
  9. * @version 1.9
  10. * @since 21-oct-2005
  11. */
  12.  
  13. /**
  14. * The required files
  15. */
  16. require_once(HTML_PATH.'/Html.php');
  17.  
  18. /**
  19. * Generates a table row
  20. * <code>
  21. * ---------------------------------
  22. * | dat_1 | dat_2 | dat_3 |
  23. * ---------------------------------
  24. * Usage:
  25. * $tr = new Tr($class);
  26. * print $tr->getHtml();
  27. * Or
  28. * Tr::display($class);
  29. * Or
  30. * Tr::start($class);
  31. * :
  32. * Tr::end();
  33. * </code>
  34. * @package table
  35. */
  36.  
  37. class Tr extends Html {
  38. /**
  39. * @var String $class The CSS class name
  40. */
  41. var $class = '';
  42.  
  43. /**
  44. * Constructor
  45. * @param String $class The class name
  46. */
  47. function Tr($class='') {
  48. $this->Html();
  49. $this->class = $class!=''?$class:'';
  50. }
  51.  
  52. /**
  53. * Get the start html for a TR
  54. * @return String the html
  55. */
  56. function getStart() {
  57. $html = " <tr";
  58. $html .= $this->getAttribute('class');
  59. $html .= ">\r\n";
  60. return $html;
  61. }
  62.  
  63. /**
  64. * Get the end html for a TR
  65. * @return String the html
  66. */
  67. function getEnd() {
  68. return " </tr>\r\n";
  69. }
  70.  
  71. /**
  72. * Get the complete html for a TR
  73. * @return String the html
  74. */
  75. function getHtml() {
  76. $html = '';
  77. $html .= $this->getStart();
  78. $html .= $this->getElements();
  79. $html .= $this->getEnd();
  80. return $html;
  81. }
  82.  
  83. /**
  84. * Get the start of the tag
  85. * <code>
  86. * Usage:
  87. * Tr::start($class);
  88. * </code>
  89. * @static
  90. * @param String $class The class name
  91. */
  92. function start($class='') {
  93. $html = new Tr($class);
  94. $html->addHtml($html->getStart());
  95. }
  96.  
  97. /**
  98. * Get the end of the tag
  99. * <code>
  100. * Usage:
  101. * Tr::end();
  102. * </code>
  103. * @static
  104. */
  105. function end() {
  106. $html = new Html();
  107. $html->addHtml(Tr::getEnd());
  108. }
  109.  
  110. /**
  111. * Display html
  112. * <code>
  113. * Usage:
  114. * Tr::display($class);
  115. * </code>
  116. * @static
  117. * @param String $class The class name
  118. */
  119. function display($class='') {
  120. $html = new Tr($class);
  121. $html->addHtml();
  122. }
  123. }
  124. ?>

Documentation generated on Thu, 22 Dec 2005 17:21:03 +0100 by phpDocumentor 1.3.0RC3