Structure
Previous Topic  Next Topic 

All components should be in their own unit/file (there are some exceptions) and the name of the unit should always be class.Tclassname.php.


Most visual components should be and are a descendant (ie extends in php) of the class TAbstractHtmlComponent


For example the class TLabel looks like this


       class TLabel extends TAbstractHtmlComponent{…


and most components should implement at least a  constructor method …as in…


       function __construct($name='',$top='',$left='',$caption=''){


which is the TLabel constructor and gethtml() method


       function gethtml(){..


Components can own other components by using the addobject() method. This method is defined in the TComponent class so we dont ever need to define it or override or re-declare it.


Probably the most important class is the THTMLPage class. This is usually the base class of a new page/screen. It generates the <HTML><HEAD><BODY…</HTML>

tags for the page along with a few others for included style sheets (using the addcss() method) and included scripts (using the addheaderscript() method)