netbank.eksperter.dk-logo.gif
Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Layout  /  Logo   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 tls.gif     Layout  trs.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

Logo.php


Vis: Sample code, tutorial

Logo, Sample code, tutorial

Sådan benyttes komponenten Logo klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

Logo, Sådan vises komponenten

Sådan vises komponenten Logo klassen


Vis: PHP source code

Logo, PHP source code

Den fulde PHP kildekode for Logo klassen

<?php
/**
 * @package base
 * @see HTML_LAYOUT_PAGE_PATH.'/Logo.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_UTIL_PATH.'/Links.php');
require_once(
HTML_BASE_UTIL_PATH.'/Div.php');

/**
 * Generates the hidden Info as html
 * <code>
 * Usage:
 *   $html = new Logo($text, $class, $align, $id);
 *   print $html->getHtml();
 * Or:
 *   Logo::display($text, $class, $align, $id);
 * </code>
 * @package base 
 */

class Logo extends Div {
    
/**
     * Constructor
     * @param String $text  The text for the div or an object
     * @param String $class The css class of the div
     * @param String $align The align attribute
     * @param String $id    The ID attribute
     */
    
function __construct($text=''$class=''$align=''$id='') {
        
parent::__construct($text$class$align$id);
    }

    
/**
     * Returns the html object for the Info
     * @return Object the link and logo as an object
     */
    
function newContent() {
        
$text   "";
        
$href   "";
        
$class  CSS_CANVAS;
        
$object = new Links(LINK_LOGO$text$href$class);
        
$width  "";
        
$height "";
        
$alt    "";
        
$object->add(new Images(IMAGE_LOGO$width$height$alt$class));
        return 
$object;
    }

    
/**
     * Returns the html for the Info
     * @return String the complete html
     */
    
function getHtml() {
        
$html  '';
        if (
LAYOUT_SHOW LAYOUT_SHOW_LOGO && HTTP_USER_AGENT!=HTTP_USER_AGENT_P900) {
            if (
defined('CREATE_RUNTIME_KERNEL') && CREATE_RUNTIME_KERNEL) {
                
$html .= '<?php'.ucfirst($this->getClassName()).'::display()?>';
            } else {
                if (
defined('LOGIN_USERNAME') && LOGIN_USERNAME==='' && CACHE_LAYOUT && $this->getCacheFileName(CACHE_LAYOUT_PATH) != '' && file_exists($this->getCacheFileName(CACHE_LAYOUT_PATH))) {
                    
$html .= $this->content($this->getCacheFileName(CACHE_LAYOUT_PATH));
                } else {
                    
$this->add($this->newContent());
                    
$html .= $this->getStart();
                    
$html .= $this->getEnd();
                    if (
CACHE_LAYOUT && defined('LOGIN_USERNAME') && LOGIN_USERNAME==='') {
                        
$this->save($htmlCACHE_LAYOUT_PATH);
                    }
                }
            }
        }
        return 
$html;
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    Logo::display($text, $class, $align, $id);
     * </code> 
     * @static
     * @param String $text  The text for the div or an object
     * @param String $class The css class of the div
     * @param String $align The align attribute
     * @param String $id    The ID attribute
     */
    
public static function display($text=''$class=''$align=''$id='') {
        
$html = new Logo($text$class$align$id);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

Logo, HTML source code

Den fulde HTML kildekode for Logo klassen

<?
<div><!-- DEBUGLinks -->
<
class="baseCanvas" href="/source-code/layout/Logo/index.php"><!-- DEBUGImages -->
<
img src="/myphp-1.11/myphp-1.11-netbank.eksperter.dk/html/images/netbank.eksperter.dk-logo.gif" alt="netbank.eksperter.dk-logo.gif" class="baseCanvas" />
</
a>
</
div>

?>

Vis: Class methods

Logo, Class methods

Her er 'klasse metoderne' for Logo klassen:

  • __construct
  • newContent
  • getHtml
  • display
  • getStart
  • getEnd
  • start
  • end
  • 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

Logo, Object vars

Her er 'objekt variable' for Logo 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.3.3-7+squeeze3) 1.11
blank.gif