Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  HTML Generator  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: HTML Generator
Compose and output HTML documents programatically
Author: By
Last change:
Date: 2005-08-25 08:14
Size: 1,566 bytes
 

Contents

Class file image Download
<?php
    
/**
     *  Example script
     *
     */
     
require_once('htmlgenerator.inc.php');
    
$htmlgenerator = new HTMLGenerator();


    
$options = array(=> 'value1, option1'
                      
=> 'value2, option2',
                      
=> 'value3, option3');

    
$dataArray = array(
                        array(
'row1 data1','row1 data2','row1 data3','row1 data4'),
                        array(
'row2 data1','row2 data2')
                        );

    
$paramArray = array(
                        array(
'','','',''),
                        array(
'colspan="2"','colspan="2"'));
                      
    
    
    
$htmlgenerator->text('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">');
    
$htmlgenerator->openTag('html');
    
$htmlgenerator->openTag('head');
    
$htmlgenerator->openTag('title');
    
$htmlgenerator->text('Rochak ka code');                            
    
$htmlgenerator->closeTag('title');
    
$htmlgenerator->closeTag('head');
    
    
$htmlgenerator->openTag('body');
    
    
$htmlgenerator->openTag('div',false,' id="rochak"');
    
$htmlgenerator->input('radio','name','a'false);
    
$htmlgenerator->input('checkbox','name','b'false);
    
$htmlgenerator->lineBreak();
    
$htmlgenerator->input("text","lol",'',false,"size=\"5\" maxlength=\"128\"");
    
$htmlgenerator->horizontalLineBreak();
    
$htmlgenerator->select('test',$options);        
    
    
    
$htmlgenerator->image('o2.jpg','hello',50,50);
    
$htmlgenerator->closeTag('div');
    
$htmlgenerator->closeTag('html');
    
    
$htmlgenerator->table('test',1,'100',$dataArray$paramArray);
    
//$htmlgenerator->dumpCode();
    
$htmlgenerator->writeCode();
    
$htmlgenerator->openTag('body');
    
$htmlgenerator->openTag('html');
?>