HTML
[ class tree: HTML ] [ index: HTML ] [ all elements ]

Class: HTMLtables

Source Location: /HTMLtables.php

Class Overview

Strings
   |
   --HTML
      |
      --HTMLtables

This class manages HTMLtables objects. This class creates xHTML tables.


Author(s):

Version:

  • 1.2

Variables

Methods


Child classes:

HTMLtablesRows
This class manages HTMLtablesRows objects. This class creates xHTML tables rows.

Inherited Variables

Inherited Methods

Class: HTML

HTML::HTMLCloseTag()
HTML closing tag function
HTML::HTMLOpenTag()
HTML opening tag function

Class: Strings

Strings::__construct()
Construction function
Strings::console()
Console function
Strings::IsUTF8()
UTF8 detection function
Strings::QuoteStrip()
Quotes stripping function
Strings::RemoveAccent()
Accents removal function
Strings::RemoveSpaces()
Spaces removal function
Strings::stringHasNumbers()
Numbers detection function
Strings::ToUTF8()
UTF8 conversion function
Strings::ucwordsw()
Special uppercase function

Class Details

[line 31]
This class manages HTMLtables objects. This class creates xHTML tables.

Created on 08 apr 09

Changes: 1.1 -> 1.2: 21 jul 09 added: file is PEAR compatible 1.0 -> 1.1: 06 may 09 added: to HTML package




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  1.2
license:  GNU Public License


[ Top ]


Class Variables

$html_needclose =  true

[line 42]

Variable that contains switch defining if tag needs to be closed



Tags:

access:  protected

Type:   bool
Overrides:   Array


[ Top ]

$html_tag =  "table"

[line 37]

Variable that contains tag



Tags:

access:  protected

Type:   string
Overrides:   Array


[ Top ]



Class Methods


method HTMLTableClose [line 127]

string HTMLTableClose( )

HTML closing table tag function

This function is used to close xHTML table tags. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $oHTMLtables            new HTMLtables();
  3.  echo $oHTMLtables->HTMLTableClose();
  4.  // </table>
  5.  ?>




Tags:

return:  xHTML string corresponding to closed tag
since:  version 1.0
usedby:  HTMLtables::HTMLTableConstruct()
uses:  HTML::HTMLCloseTag()


[ Top ]

method HTMLTableConstruct [line 219]

string HTMLTableConstruct( array $aTableDatas, [string $name = null], [string $id = null], [string $class = null], [string $style = null], [array $aScript = null])

HTML table construction function

This function is used to construct xHTML tables. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $tableclass           "myTableClass";
  3.  $oCell1content        new Strings();
  4.  $oCell1content->value "This is a test";
  5.  $aCell1parameters     array("class" => "myClass");
  6.  $oCell2content        new Strings();
  7.  $oCell2content->value "Foo";
  8.  $aCell2parameters     array("style" => "background-color: red;");
  9.  $aRow1Parameters      array("class" => "line1class");
  10.  $oCell3content        new Strings();
  11.  $oCell3content->value "bar";
  12.  $aCell3parameters     array("style" => "color: yellow;");
  13.  $oCell4content        new Strings();
  14.  $oCell4content->value "Table test";
  15.  $aCell4parameters     array("class" => "fooClass");
  16.  $aRow2Parameters      array("class" => "line2class",
  17.       "aScript" => array("onclick" => "go();"));
  18.  $aRow1                array(
  19.       array(
  20.           array(
  21.               $oCell1content,
  22.               $aCell1parameters
  23.           ),
  24.           array(
  25.               $oCell2content,
  26.               $aCell2parameters
  27.           )
  28.       ),
  29.       $aRow1Parameters
  30.  );
  31.  $aRow2                array(
  32.       array(
  33.           array(
  34.               $oCell3content,
  35.               $aCell3parameters
  36.           ),
  37.           array(
  38.               $oCell4content,
  39.               $aCell4parameters
  40.           )
  41.       ),
  42.       $aRow2Parameters
  43.  );
  44.  $aTableDatas          array($aRow1$aRow2);
  45.  $oHTMLtables         new HTMLtables();
  46.  echo $oHTMLtables->HTMLTableConstruct($aTableDatas$tableclass);
  47.  // <table class="myTableClass"><tr class="line1class"><td
  48.  class="myClass">This is a test</td><td style="background-color: red;">
  49.  Foo</td></tr><tr class="line2class" onclick="go();"><td
  50.  style="color: yellow;">bar</td><td class="fooClass">Table test</td>
  51.  </tr></table>
  52.  ?>




Tags:

return:  xHTML string corresponding to HTML table
since:  version 1.0
usedby:  WBcollection::renderHTMLresults()
uses:  HTMLtables_Rows::HTMLTableRowConstruct()
uses:  HTMLtables::HTMLTableOpen()
uses:  HTMLtables::HTMLTableClose()


Parameters:

array   $aTableDatas   array containing xHTML table data
string   $name   name of the xHTML table
string   $id   id of the xHTML table
string   $class   class of the xHTML table
string   $style   style of the xHTML table
array   $aScript   array containing script data

[ Top ]

method HTMLTableOpen [line 82]

string HTMLTableOpen( [ $name = null], [ $id = null], [string $class = null], [string $style = null], [array $aScript = null], string $this->html_tag, bool $this->html_needclose)

xHTML Table opening tag function

This function is used to open xHTML table tags. Result is stored in $this->html_output (added to the end of the string) and returned.

  1.  <?php
  2.  $aScript      array("onfocus" => "go();");
  3.  $oHTMLtables new HTMLtables();
  4.  echo $oHTMLtables->HTMLTableOpen(
  5.       null,
  6.       null,
  7.       "passedclass",
  8.       "passedstyle",
  9.       $aScript
  10.  );
  11.  // <table class="passedclass" style="passedstyle" onfocus="go();">
  12.  ?>




Tags:

return:  xHTML string corresponding to opened tag
since:  version 1.0
usedby:  HTMLtables::HTMLTableConstruct()
uses:  HTML::HTMLOpenTag()


Parameters:

string   $this->html_tag   xHTML tag to be opened
string   $class   xHTML class parameter
string   $style   xHTML style parameter
array   $aScript   scripts to be added
bool   $this->html_needclose   switch defining if the tag needs to be closed
   $name  
   $id  

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:23 +0200 by phpDocumentor 1.4.1