![]() |
You can derive all documented object of the „Portalsuite Objects“ library in own classes and then again build instances thereof.
In deriving you have got the possibility, as usual, to overwrite and therewith modify functions. We would like to show this with a little example with the class PTemplate: Template excerpt:
<?
Class MyOwnTemplate extends PTemplate
{
var $MyTemplateValue;
function MyOwnTemplate ()
{
$this->MyTemplateValue = "";
parent::PTemplate ();
}
function Field ($Field)
{
if ($Field=="TemplateValue")
return ($this->MyTemplateValue);
}
function WriteField ($Field,$Content)
{
if ($Field=="TemplateValue")
$this->MyTemplateValue = $Content;
}
function Valid ()
{
return (1);
}
}
$ATestTemplate = new MyOwnTemplate;
$ATestTemplate->WriteField ($Field,"
<?
echo (\"This is a test template ;-)\");
?>
");
$ATestTemplate->Output ();
?>