Sådan benyttes komponenten ViewCompanyInfo klassen
Først skal du inkludere den fil der beskriver komponenten, som en klasse fil
<? require_once(HTML_PACKAGE_PATH.'/ViewCompanyInfo.php'); ?>
Dernæst kan du enten benytte komponenten som et taglib (statiske metoder):
<? ViewCompanyInfo::display($param1, $param2, $param3, ...); ?>
eller du kan lave en instance af komponenten og benytte metoderne direkte:
<? $object = new ViewCompanyInfo($param1, $param2, $param3, ...); print $object->getHtml(); ?>
Sådan vises komponenten ViewCompanyInfo klassen
Den fulde PHP kildekode for ViewCompanyInfo klassen
<?php/** * @package db-basket * @see HTML_DB_CUSTOMER_VIEW_PATH.'/ViewCompanyInfo.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_MVC_VIEW_PATH.'/ViewInfo.php');/** * Generates the html for a View Company Info * <code> * Usage: * $view = new ViewCompanyInfo($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $layout); * print $view->getHtml(); * Or * ViewCompanyInfo::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $layout); * * Generates a complete View Company Info interface * +--------+ * | Header | * +--------+ * | data1 | * | data2 | * +--------+ * </code> * @package db-basket */class ViewCompanyInfo extends ViewInfo { /** * Constructor * @param DataReader / array $datareader The Data Reader object OR an array * @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 * @param String $layout The layout to use */ function __construct($datareader=null, $text='', $width='', $class='', $border='', $cellpadding='', $cellspacing='', $summary='', $caption='', $layout='') { parent::__construct($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $layout); } /** * Display html * <code> * Usage: * ViewCompanyInfo::display($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $layout); * </code> * @static * @param DataReader / array $datareader The Data Reader object OR an array * @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 * @param String $layout The layout to use */ public static function display($datareader=null, $text='', $width='', $class='', $border='', $cellpadding='', $cellspacing='', $summary='', $caption='', $layout='') { $html = new ViewCompanyInfo($datareader, $text, $width, $class, $border, $cellpadding, $cellspacing, $summary, $caption, $layout); $html->addHtml(); }}?>
Den fulde HTML kildekode for ViewCompanyInfo klassen
<? <!-- DEBUG: ViewCompanyInfo --> <table id="ViewCompanyInfoId" width="400" class="tableBusinessCardView baseBorder" border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="top">HvepseEksperten.dk ApS<br /> Kongens Vænge 79<br /> 3400 Hillerød<br /> Finn Rasmussen<br /> Mobil telefon: 40506069<br /> <!-- DEBUG: EmailLink --> <!-- test@hvepse-eksperten.dk --><a class="baseLinkColor" href="mailto:test@hvepse-eksperten.dk" title="test@hvepse-eksperten.dk">test@hvepse-eksperten.dk</a> <br /> </td> </tr> </table> ?>
Her er 'klasse metoderne' for ViewCompanyInfo klassen:
Her er 'objekt variable' for ViewCompanyInfo klassen: