Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif You are here: /  Top page  /  The source code  /  Table  /  Tr   Logon now   Logon
blank.gif
««« Show Source Code
blank.gif
tl.gif Base tr.gif tl.gif Basic tr.gif tl.gif Dto tr.gif tl.gif Form tr.gif tl.gif Language tr.gif tl.gif Layout tr.gif tl.gif Menu tr.gif tl.gif Mvc tr.gif tl.gif Netbank.eksperter.dk tr.gif tl.gif Tab tr.gif tls.gif     Table  trs.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  

Show: PHP source code

Tr, PHP source code

The full PHP source code for the Tr class

<?php
/**
 * @package table
 * @filesource
 * @see HTML_TABLE_COMPONENT_PATH.'/Tr.php'
 * @copyright (c) http://Finn-Rasmussen.com
 * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
 * @author http://Finn-Rasmussen.com
 * @version 1.11
 * @since 27-nov-2009
 */

/**
 * The required files
 */
require_once(HTML_BASE_COMMON_PATH.'/Html.php');

/**
 * Generates a table row
 * <code>
 * ---------------------------------
 * | dat_1 | dat_2 | dat_3 | 
 * ---------------------------------
 * Usage:
 *   $td = new Td(); // Optionally
 *   $tr = new Tr($class, $td);
 *   print $tr->getHtml();
 * Or
 *   Tr::display($class, $td);
 * Or
 *   Tr::start($class, $td);
 *      :
 *   Tr::end();
 * </code>
 * @package table
 */

class Tr extends Html {
    
/**
     * @var String $class The CSS class name
     */
    
protected $class '';

    
/**
     * Constructor
     * @param String $class The class name
     * @param Td     $td    The Td object
     */
    
function __construct($class=''$td='') {
        
parent::__construct();
        
$this->class  $class != ''?$class:'';
        if (
$td!= '') {
            if ( 
$td instanceof Td ) {
                
$this->add($td);
            } else {
                die(
'File: '.__FILE__."<br />\r\nLine: ".__LINE__."<br />\r\n".' Wrong object, expected Td, found='.$td);
            }
        }
    }

    
/**
     * Get the start html for a TR
     * @return String the html
     */
    
function getStart() {
        
$html  " <tr";
        
$html .= $this->getAttribute('class');
        
$html .= ">\r\n";
        
$html .= $this->getElements();
        return 
$html;
    }

    
/**
     * Get the end html for a TR
     * @return String the html
     */
    
function getEnd() {
        return 
" </tr>\r\n";
    }

    
/**
     * Get the complete html for a TR
     * @return String the html
     */
    
function getHtml() {
        
$html  '';
        
$html .= $this->getStart();
        
$html .= $this->getEnd();
        return 
$html;
    }

    
/**
     * Get the start of the tag
     * <code>
     * Usage:
     *    Tr::start($class); 
     * </code>
     * @static
     * @param String $class The class name
     * @param Td     $td    The Td object
     */
    
public static function start($class=''$td='') {
        
$html = new Tr($class$td);
        
$html->addHtml($html->getStart());
    }

    
/**
     * Get the end of the tag
     * <code>
     * Usage:
     *    Tr::end(); 
     * </code>
     * @static
     */
    
public static function end() {
        
$html = new Tr();
        
$html->addHtml($html->getEnd());
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    Tr::display($class, $td); 
     * </code>
     * @static
     * @param String $class The class name
     * @param Td     $td    The Td object
     */
    
public static function display($class=''$td='') {
        
$html = new Tr($class$td);
        
$html->addHtml();
    }
}
?>

Show: HTML source code

Tr, HTML source code

The HTML source code for the Tr class

<?
 
<tr>
 </
tr>

?>

Show: Class methods

Tr, Class methods

The 'class methods' for the Tr class are:

  • __construct
  • getStart
  • getEnd
  • getHtml
  • start
  • end
  • display
  • setObject
  • set
  • get
  • getAttribute
  • getTag
  • add
  • getSizeof
  • getElement
  • getElements
  • getToogle
  • getMaximize
  • getMinimize
  • newTriangle
  • getStartHtml
  • getEndHtml
  • showsource
  • getClassName
  • getMsg
  • addHtml
  • __toString
  • getCacheFileName
  • save
  • content

Show: Object vars

Tr, Object vars

The 'object vars' for the Tr class are:

  • html =>
  • sql =>

Back

Minimize: Name

Tr.php


Show: Sample code, tutorial

Tr, Sample code, tutorial

How to use the Tr class

First include the component file

  • <?
    require_once(HTML_PACKAGE_PATH.'/Tr.php');
    ?>

Use the component as a taglib:

  • <?
    Tr
    ::display($param1$param2$param3, ...);
    ?>

Or use the component as an object:

  • <?
    $object 
    = new Tr($param1$param2$param3, ...);
    print 
    $object->getHtml();
    ?>

Minimize: An example of usage of the

Tr, An example of usage of the

An example of usage of the Tr class

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 Web Expert www.Finn-Rasmussen.com Powered by myPHP Version (5.2.6-1+lenny9) 1.11
blank.gif