Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Base  /  Bodystart   Login nu   Login
blank.gif
««« Se kilde koden
blank.gif
tls.gif     Base  trs.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 tl.gif Table tr.gif tl.gif Util tr.gif
blank.gif
blank.gif
arrow-headline.gif Index
MenuLink  MenuLeft  
Tilbage

Skjul: Navn

BodyStart.php


Vis: Sample code, tutorial

BodyStart, Sample code, tutorial

Sådan benyttes komponenten BodyStart klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

BodyStart, Sådan vises komponenten

Sådan vises komponenten BodyStart klassen


Vis: PHP source code

BodyStart, PHP source code

Den fulde PHP kildekode for BodyStart klassen

<?php
/**
 * @package base
 * @see HTML_BASE_PAGE_PATH.'/BodyStart.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 the Body Start
 * <code>
 * Usage:
 *   $bodystart = new BodyStart($background, $id, $onload, $onunload);
 *   print $bodystart->getHtml();
 * Or:
 *   BodyStart::display($background, $id, $onload, $onunload);
 * </code>
 * @package base 
 */

class BodyStart extends Html {
    
/**
     * @var String $background The url to the background image
     */
    
protected $background '';
    
    
/**
     * @var String $id The id
     */
    
protected $id '';
    
    
/**
     * @var String $onload The onload javascript methode to call
     */
    
protected $onload '';
    
    
/**
     * @var String $onunload The onunload javascript methode to call
     */
    
protected $onunload '';
    
    
/**
     * Constructor
     * @param String $background The url to the background image. Not xhtml 1.0 strict compliant
     * @param String $id         The id
     * @param String $onload     The onload event
     * @param String $onunload   The onunload event
     */
    
function __construct($background=''$id=''$onload=''$onunload='') {
        
parent::__construct();
        
$this->background $background != '' $background BODY_BACKGROUND;
        
$this->id         $id;
        
$this->onload     $onload;
        
$this->onunload   $onunload;
    }

    
/**
     * Returns the html for the Body start
     * @return String the complete html
     */
    
function getHtml() {
        
$html  '';
        
$html .= "</head>\r\n<body";
        
$html .= $this->getAttribute('background'); // Not xhtml 1.0 strict compliant
        
$html .= $this->getAttribute('id');
        
$html .= $this->getAttribute('onload');
        
$html .= $this->getAttribute('onunload');
        
$html .= ">\r\n";
        
$command = !empty($_GET[REQUEST_PRINTER]) && $_GET[REQUEST_PRINTER] != '' $_GET[REQUEST_PRINTER] : '';
        if (
$command === VIEW_PRINTER) {
            
$html .= '<form action="#" method="get">'."\r\n";
            
$html .= '<div class="'.CSS_ALIGN_RIGHT.'">'."\r\n";
            
$html .= '<input class="'.CSS_PRINTER.'" type="button" value="'.BUTTON_PRINT.'" onclick="javascript:window.print();" />'."\r\n";
            
$html .= '<input class="'.CSS_PRINTER.'" type="button" value="'.BUTTON_CLOSE.'" onclick="javascript:window.close();" />'."\r\n";
            
$html .= '<input class="'.CSS_PRINTER.'" type="button" value="'.BUTTON_BACK.'"  onclick="javascript:history.back();" />'."\r\n";
            
$html .= "</div>\r\n";
            
$html .= "</form>\r\n";
        }
        return 
$html;
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    BodyStart::display($background, $id, $onload, $onunload); 
     * </code>
     * @static
     * @param String $background The url to the background image. Not xhtml 1.0 strict compliant
     * @param String $id         The id
     * @param String $onload     The onload event
     * @param String $onunload   The onunload event
     */
    
public static function display($background=''$id=''$onload=''$onunload='') {
        
$html = new BodyStart($background$id$onload$onunload);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

BodyStart, HTML source code

Den fulde HTML kildekode for BodyStart klassen

<?
</head>
<
body>

?>

Vis: Class methods

BodyStart, Class methods

Her er 'klasse metoderne' for BodyStart klassen:

  • __construct
  • getHtml
  • 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

BodyStart, Object vars

Her er 'objekt variable' for BodyStart klassen:

  • html =>
  • sql =>

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.2.6-1+lenny8) 1.11
blank.gif