Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP > PHP Application Design
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Feb 11, 2003, 11:20   #1
Sork
SitePoint Zealot
 
Sork's Avatar
 
Join Date: Jul 2002
Location: Portugal
Posts: 143
HtmlTableWidgets

I'm planning to use in my admin sections widgets to generate the html.
So i started to look for libs to do that but what i found were too BIG!!!
This way i decided to try doing it myself, what i have in mind is something like this
PHP Code:

$html =& new eBHtmlGenerator();

//==============
$head =& $html->addTag(new eBHtmlHeadTag);
$head->setTitle('Title');
$head->setMeta('keywords','blabla');
//==============
$table =& $html->addTag(new eBHtmlTableTag);
for (
$it =& new ArrayIterator($form->export()); $it->isValid(); $it->next())
{
    
$element =& $it->getCurrent();
    
$row =& $table->addRow();
    
$row->setParam('class','row4');
    
$cell1 =& $row->addCell(new eBHtmlAnchorTag('#',new eBHtmlImageTag('seta.gif')));
    
$cell1->setParam('width','15');
    
$cell2 =& $row->addCell($element->getLabel());
    
$cell2->setParam('width','150');
    
$cell3 =& $row->addCell($element->getHtml());
    
$cell3->setParam('width','200');
}
//==============
$html->display();
This is how i would like to use it.
But should the rows be an seperated object (idem cells)? This could lead to an collapse of the server?
What your opinions?
thanks!
Sork is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 01:06.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved