Top  Branding  Banner 
blank.gif
blank.gif
triangle.gif Du er her: /  Forsiden  /  Kildekoden  /  Netbank.eksperter.dk  /  Viewotheraccount   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 tl.gif Layout tr.gif tl.gif Menu tr.gif tl.gif Mvc tr.gif tls.gif     Netbank.eksperter.dk  trs.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

ViewOtherAccount.php


Vis: Sample code, tutorial

ViewOtherAccount, Sample code, tutorial

Sådan benyttes komponenten ViewOtherAccount klassen

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

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

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

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

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

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

Skjul: Sådan vises komponenten

ViewOtherAccount, Sådan vises komponenten

Sådan vises komponenten ViewOtherAccount klassen





Vis: PHP source code

ViewOtherAccount, PHP source code

Den fulde PHP kildekode for ViewOtherAccount klassen

<?php
/**
 * @package netbank.eksperter.dk
 * @see HTML_NETBANK_EKSPERTER_DK_VIEW_PATH.'/ViewOtherAccount.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');
require_once(
HTML_FORM_COMPONENT_PATH.'/Label.php');
require_once(
HTML_FORM_COMPONENT_PATH.'/Text.php');

/**
 * Generates the html for a Netbank Other Account view
 * The generated HTML looks like the following
 *    <table>
 *       <tr>
 *          <td colspan="2">
 *             <label for="id1">$label</label>
 *          </td>
 *       </tr>
 *       <tr>
 *          <td>
 *             <input type="text" />
 *          </td>
 *          <td>
 *             <input type="text" />
 *          </td>
 *       </tr>
 *    </table>
 *    
 * <code>
 * Usage:
 *   $name    = "transferType";
 *   
 *   $view = new ViewOtherAccount($name, $label);
 *   print $view->getHtml();
 * Or
 *   ViewOtherAccount::display($name, $label);
 *
 * Generates a complete View for a other account number view
 * +--------------------------------
 * | Reg no | kontonr.             |
 * +--------------------------------
  * </code>
 * @package netbank.eksperter.dk
 */

class ViewOtherAccount extends Html {
    
/**
     * @var String $name The name of the select element
     */
    
private $name    "";
    
/**
     * @var String $label The label text for the associated select element
     */
    
private $label   "";
    
    
/**
     * Constructor
     * @param String $name    The name of the select box
     * @param String $label   The label text for the select box
     */
    
function __construct($name=''$label='') {
        
parent::__construct();
        
/**
         * Initialize the internal object members
         */
        
$this->name  $name  !== "" $name  "TODO how to add 2 text fields on same line";
        
$this->label $label !== "" $label Translate::sql("Registration      Kontonummer  TODO");
        
/**
         * Add the components to the final HTML
         */
        
$this->addComponents();
    }
    
    
/**
     * Add the components which will generate the final HTML
     */
    
private function addComponents() {
        
$datareader null;
        
$table = new Table($datareader""""CSS_X_LARGE"0""0""0");
        
// row 1
        
$tr = new Tr();
        
// Column 1 + 2
        
$td = new Td(""""2);
        
$td->add(new Label($this->label));
        
$tr->add($td);
        
$table->add($tr);
        
        
// row 2
        
$tr = new Tr();
        
// Column 1
        
$td = new Td();
        
$class CSS_XX_SMALL.' '.CSS_BORDER.' '.CSS_BODY;
        
$td->add(new Text($this->name""$class));
        
$tr->add($td);
        
// Column 2
        
$td = new Td(CSS_ALIGN_RIGHT);
        
$class CSS_MEDIUM.' '.CSS_BORDER.' '.CSS_BODY;
        
$td->add(new Text($this->name""$class));
        
$tr->add($td);
        
$table->add($tr);
        
        
// Finally, add the whole stuff
        
$this->add($table);
    }
    
    
/**
     * Display html
     * <code>
     * Usage:
     *    ViewOtherAccount::display($name, $label); 
     * </code>
     * @static
     * @param String $name    The name of the select box
     * @param String $label   The label text for the select box
     */
    
public static function display($name=''$label='') {
        
$html = new ViewOtherAccount($name$label);
        
$html->addHtml();
    }
}
?>

Vis: HTML source code

ViewOtherAccount, HTML source code

Den fulde HTML kildekode for ViewOtherAccount klassen

<?
<!-- DEBUGViewOtherAccount -->
<!-- 
DEBUGTable -->
<!-- 
DEBUGTableHeader -->
<!-- 
No text in TableHeader -->

<
table width="100%" class="formXLARGE" border="0" cellpadding="0" cellspacing="0">
 <
tr>
    <
td valign="top" colspan="2"><!-- DEBUGLabel -->
<
label for="Label1" accesskey="E" title="Accelerator key, use (Alt + E)">
    <
b>R<span class="baseColorDark">e</span>gistration&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kontonummer&nbsp;&nbsp;TODO</b>&nbsp; (Alt E) </label><br />

</
td>
 </
tr>

 <
tr>
    <
td valign="top"><!-- DEBUGText -->
<
input type="text" name="TODO_how_to_add_2_text_fields_on_same_line" id="Label1" class="formXXSmall baseBorder baseBody" value="" tabindex="1" /><br />

</
td>
    <
td class="baseAlignRight" valign="top"><!-- DEBUGText -->
<
input type="text" name="TODO_how_to_add_2_text_fields_on_same_line" class="formMEDIUM baseBorder baseBody" value="" tabindex="2" /><br />

</
td>
 </
tr>

</
table>


?>

Vis: Class methods

ViewOtherAccount, Class methods

Her er 'klasse metoderne' for ViewOtherAccount klassen:

  • __construct
  • display
  • setObject
  • set
  • get
  • getAttribute
  • getTag
  • add
  • getSizeof
  • getElement
  • getElements
  • getToogle
  • getMaximize
  • getMinimize
  • newTriangle
  • getStartHtml
  • getEndHtml
  • getHtml
  • showsource
  • getClassName
  • getMsg
  • addHtml
  • __toString
  • getCacheFileName
  • save
  • content

Vis: Object vars

ViewOtherAccount, Object vars

Her er 'objekt variable' for ViewOtherAccount 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
Messages