blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Mvc  /  Viewbusinesscard   Login nu   Login
blank.gif
blank.gif
triangle.gif Basic Base Component Db Dto Form Form-elements Jquery Layout Menu Menu-fisheye Mvc  Tab Table Template Util
blank.gif
blank.gif
 
arrow-headline.gif Index
 
  Tilbage

Navn : ViewBusinessCard.php


Sample code, tutorial

Sådan benyttes komponenten ViewBusinessCard klassen

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

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

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

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

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

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

Parent html

Sådan vises komponenten ViewBusinessCard klassen

Privat telefon: 48246030
Finn Rasmussen
HvepseEksperten.dk ApS
Kongens Vænge 79
3400 Hillerød
Denmark

PHP source code

Den fulde PHP kildekode for ViewBusinessCard klassen

<?
/**
* @package mvc
* @see HTML_MVC_VIEW_PATH.'/ViewBusinessCard.php'
* @copyright (c) http://Finn-Rasmussen.com
* @license http://Finn-Rasmussen.com/license/ myPHP License conditions
* @author http://Finn-Rasmussen.com
* @version 1.10
* @since 22-feb-2007
*/

/**
* The required files
*/
require_once(HTML_MVC_VIEW_PATH.'/ViewInfo.php');

/**
* Generates the html for a View like a business card look-a-like
* <code>
* Usage:
*   $view = new ViewBusinessCard($datareader,$text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
*   print $view->getHtml();
* Or
*   ViewBusinessCard::display($datareader,$text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
*
* Generates a complete View Business Card interface
* +--------+
* | Header |
* +--------+
* | data1  |
* | data2  |
* | ...    |
* +--------+
* </code>
* @package mvc
*/

class ViewBusinessCard extends ViewInfo {
    
/**
     * Constructor
     * @param DataReader $datareader The Data Reader object
     * @param String $text    The text header for the table
     * @param String $width   The Width for the table
     * @param String $class   The Class
     * @param String $border  The Border
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption
     */
    
function ViewBusinessCard($datareader,$text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
        
$theText        = $text!=''?$text:'';

        
// Global table characteristics
        
$theWidth       = $width!=''?$width:BUSINESS_CARD_VIEW_WIDTH;
        
$theClass       = $class!=''?$class:BUSINESS_CARD_VIEW_CLASS;
        
$theBorder      = $border!=''?$border:BUSINESS_CARD_VIEW_BORDER;
        
$theCellPadding = $cellpadding!=''?$cellpadding:BUSINESS_CARD_VIEW_CELLPADDING;
        
$theCellSpacing = $cellspacing!=''?$cellspacing:BUSINESS_CARD_VIEW_CELLSPACING;
        
$this->ViewInfo($datareader,$theText,$theWidth,$theClass,$theBorder,$theCellPadding,$theCellSpacing,$summary,$caption);
    }

    
/**
     * Display html
     * <code>
     * Usage:
     *    ViewBusinessCard::display($datareader,$text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
     * </code>
     * @static
     * @param DataReader $datareader The Data Reader object
     * @param String $text    The text header for the table
     * @param String $width   The width of the table
     * @param String $class   The class of the table
     * @param String $border  The border of the table
     * @param String $cellpadding The CellSpacing
     * @param String $cellspacing The CellPadding
     * @param String $summary The Summary
     * @param String $caption The Caption
     */
    
function display($datareader,$text='',$width='',$class='',$border='',$cellpadding='',$cellspacing='',$summary='',$caption='') {
        
$html = new ViewBusinessCard($datareader,$text,$width,$class,$border,$cellpadding,$cellspacing,$summary,$caption);
        
$html->addHtml();
    }
}
?>

HTML source code

Den fulde HTML kildekode for ViewBusinessCard klassen

<?

<table width="323" class="tableBusinessCardView baseBorder" border="0" cellpadding="2" cellspacing="0">
<
tr>
    <
td valign="top">Privat telefon: 48246030<br />


Finn Rasmussen<br />


HvepseEksperten.dk ApS<br />


Kongens Vænge 79<br />


3400&nbsp;Hillerød<br />


Denmark<br />



</
td>
</
tr>

<
tr>
    <
td valign="top">Privat telefon: 48246030<br />


Finn Rasmussen<br />


HvepseEksperten.dk ApS<br />


Kongens Vænge 79<br />


3400&nbsp;Hillerød<br />


Denmark<br />



</
td>
</
tr>

</
table>

?>

Class methods

Her er 'klasse metoderne' for ViewBusinessCard klassen:

  • viewbusinesscard
  • display
  • viewinfo
  • newheader
  • newcolumn
  • newrow
  • newcontent
  • gethtml
  • object
  • getclassname
  • getmsg
  • addhtml
  • tostring
  • getcachefilename
  • save
  • content
  • html
  • setobject
  • set
  • get
  • getattribute
  • gettag
  • add
  • getsizeof
  • getelement
  • getelements
  • gettoogle
  • getmaximize
  • getminimize
  • newtriangle
  • showsource
  • table
  • newtextrow
  • gettableheader
  • getstart
  • getend
  • start
  • end
  • viewcommon
  • newhiddens
  • newbuttons
  • newelement

Object vars

Her er 'objekt variable' for ViewBusinessCard klassen:

  • html =>
  • sql =>
  • elements => Array
  • sizeof => 2
  • text =>
  • width => 323
  • class => tableBusinessCardView baseBorder
  • border => 0
  • cellpadding => 2
  • cellspacing => 0
  • summary =>
  • caption =>
  • datareader => Object
  • id =>
  • subtotal =>

DataReader.php

Her er felterne i DataReader for ViewBusinessCard klassen:

  0   














 
triangle.gif

danmark

Germany

England

France

Italy

Norge

Sverige

USA


 
blank.gif
blank.gif
blank.gif