Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Voi siete qui: /  Inizio pagina  /  Inserisci codice sorgente  /  Table  /  Tr   Logon ora   Logon
blank.gif
««« Inserisci Codice Sorgente
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 Indice
MenuLink  MenuLeft  

Visualizza: PHP source code

Tr, PHP source code

Il codice sorgente completo di PHP per la Tr classe

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

Visualizza: HTML source code

Tr, HTML source code

Il codice sorgente HTML per la Tr classe

<?
 
<tr>
 </
tr>

?>

Visualizza: Class methods

Tr, Class methods

La 'classe di metodi' per la Tr classe sono le seguenti:

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

Visualizza: Object vars

Tr, Object vars

Il 'oggetto vars' per la Tr classe sono le seguenti:

  • html =>
  • sql =>

Torna

Minimizza: Nome

Tr.php


Visualizza: Sample code, tutorial

Tr, Sample code, tutorial

Come utilizzare il Tr classe

Includere il componente prima di file

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

Utilizzare il componente come un taglib:

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

O utilizzare il componente come un oggetto:

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

Minimizza: Un esempio di utilizzo della

Tr, Un esempio di utilizzo della

Un esempio di utilizzo della Tr classe

MenuRight 
triangle.gif

Dansk

Deutch

English (UK)

France

Italy

Norsk

Svensk

English (USA)


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