Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Table  /  Tr   Login nu   Login
blank.gif
««« Se kilde koden
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  

Vis: PHP source code

Tr, PHP source code

Den fulde PHP kildekode for Tr klassen

<?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();
    }
}
?>

Vis: HTML source code

Tr, HTML source code

Den fulde HTML kildekode for Tr klassen

<?
 
<tr>
 </
tr>

?>

Vis: Class methods

Tr, Class methods

Her er 'klasse metoderne' for Tr klassen:

  • __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

Vis: Object vars

Tr, Object vars

Her er 'objekt variable' for Tr klassen:

  • html =>
  • sql =>

Tilbage

Skjul: Navn

Tr.php


Vis: Sample code, tutorial

Tr, Sample code, tutorial

Sådan benyttes komponenten Tr klassen

Først skal du inkludere den fil der beskriver komponenten, som en klasse fil

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

Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):

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

eller du kan lave en instance af komponenten og benytte metoderne direkte:

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

Skjul: Sådan vises komponenten

Tr, Sådan vises komponenten

Sådan vises komponenten Tr klassen

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


 
blank.gif
MenuBottom 
triangle.gif Copyright @ 1999-2010 www.Finn-Rasmussen.com Powered by myPHP Version (5.3.3-7+squeeze3) 1.11
blank.gif